Merge from Chromium at DEPS revision r213780

This commit was generated by merge_to_master.py.

Change-Id: I9cf93efc460166e8ae27c76302af9095b402a90e
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index d736a28..a91d6d3 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -18,7 +18,9 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/metrics/stats_table.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
+#include "base/process/memory.h"
+#include "base/process/process_handle.h"
 #include "base/profiler/alternate_timer.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
diff --git a/content/browser/DEPS b/content/browser/DEPS
index 4322368..0327aa7 100644
--- a/content/browser/DEPS
+++ b/content/browser/DEPS
@@ -66,7 +66,6 @@
   "!third_party/WebKit/public/web/WebBindings.h",
   "!third_party/WebKit/public/web/WebKit.h",
   "!third_party/WebKit/public/web/WebSecurityOrigin.h",
-  "!third_party/WebKit/public/web/WebView.h",
   "!third_party/WebKit/public/web/android/WebInputEventFactory.h",
   "!third_party/WebKit/public/web/gtk/WebInputEventFactory.h",
   "!third_party/WebKit/public/web/linux/WebFontInfo.h",
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index ca1ae40..067833e 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -731,19 +731,17 @@
 }
 
 void BrowserPluginGuest::RendererUnresponsive(WebContents* source) {
-  int process_id =
-      GetWebContents()->GetRenderProcessHost()->GetID();
-  SendMessageToEmbedder(
-      new BrowserPluginMsg_GuestUnresponsive(instance_id(), process_id));
   RecordAction(UserMetricsAction("BrowserPlugin.Guest.Hung"));
+  if (!delegate_)
+    return;
+  delegate_->RendererUnresponsive();
 }
 
 void BrowserPluginGuest::RendererResponsive(WebContents* source) {
-  int process_id =
-      GetWebContents()->GetRenderProcessHost()->GetID();
-  SendMessageToEmbedder(
-      new BrowserPluginMsg_GuestResponsive(instance_id(), process_id));
   RecordAction(UserMetricsAction("BrowserPlugin.Guest.Responsive"));
+  if (!delegate_)
+    return;
+  delegate_->RendererResponsive();
 }
 
 void BrowserPluginGuest::RunFileChooser(WebContents* web_contents,
diff --git a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
index a1c0613..5e6d887 100644
--- a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
+++ b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
@@ -377,68 +377,6 @@
   DISALLOW_COPY_AND_ASSIGN(BrowserPluginHostTest);
 };
 
-// This test loads a guest that has a busy loop, and therefore it hangs the
-// guest.
-//
-// Disabled on Windows and Linux since it is flaky. crbug.com/164812
-// THIS TEST IS ALWAYS FLAKY. DO NOT ENABLE AGAIN WITHOUT REWRITING.
-#if defined(OS_WIN) || defined(OS_LINUX)
-#define MAYBE_GuestUnresponsive DISABLED_GuestUnresponsive
-#else
-#define MAYBE_GuestUnresponsive GuestUnresponsive
-#endif
-IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest,
-                       MAYBE_GuestUnresponsive) {
-  // Override the hang timeout for guest to be very small.
-  content::BrowserPluginGuest::set_factory_for_testing(
-      TestShortHangTimeoutGuestFactory::GetInstance());
-  const char kEmbedderURL[] =
-      "/browser_plugin_embedder_guest_unresponsive.html";
-  StartBrowserPluginTest(
-      kEmbedderURL, kHTMLForGuestBusyLoop, true, std::string());
-  // Wait until the busy loop starts.
-  {
-    const string16 expected_title = ASCIIToUTF16("start");
-    content::TitleWatcher title_watcher(test_guest()->web_contents(),
-                                        expected_title);
-    // Hang the guest for a length of time.
-    int spin_time = 10 * TestTimeouts::tiny_timeout().InMilliseconds();
-    ExecuteSyncJSFunction(
-        test_guest()->web_contents()->GetRenderViewHost(),
-        base::StringPrintf("StartPauseMs(%d);", spin_time).c_str());
-
-    string16 actual_title = title_watcher.WaitAndGetTitle();
-    EXPECT_EQ(expected_title, actual_title);
-  }
-  {
-    const string16 expected_title = ASCIIToUTF16("done");
-    content::TitleWatcher title_watcher(test_embedder()->web_contents(),
-                                        expected_title);
-
-    // Send a mouse event to the guest.
-    SimulateMouseClick(test_embedder()->web_contents(), 0,
-        WebKit::WebMouseEvent::ButtonLeft);
-
-    string16 actual_title = title_watcher.WaitAndGetTitle();
-    EXPECT_EQ(expected_title, actual_title);
-  }
-
-  // Verify that the embedder has received the 'unresponsive' and 'responsive'
-  // events.
-  RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
-      test_embedder()->web_contents()->GetRenderViewHost());
-  scoped_ptr<base::Value> value =
-      content::ExecuteScriptAndGetValue(rvh, "unresponsiveCalled");
-  bool result = false;
-  ASSERT_TRUE(value->GetAsBoolean(&result));
-  EXPECT_TRUE(result);
-
-  value = content::ExecuteScriptAndGetValue(rvh, "responsiveCalled");
-  result = false;
-  ASSERT_TRUE(value->GetAsBoolean(&result));
-  EXPECT_TRUE(result);
-}
-
 // This test ensures that if guest isn't there and we resize the guest (from
 // js), it remembers the size correctly.
 //
diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc
index ce0f626..b5bb3f4 100644
--- a/content/browser/child_process_launcher.cc
+++ b/content/browser/child_process_launcher.cc
@@ -12,6 +12,7 @@
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/metrics/histogram.h"
+#include "base/process/process.h"
 #include "base/synchronization/lock.h"
 #include "base/threading/thread.h"
 #include "content/public/browser/browser_thread.h"
diff --git a/content/browser/fileapi/browser_file_system_helper.cc b/content/browser/fileapi/browser_file_system_helper.cc
index e8e81ce..a03417d 100644
--- a/content/browser/fileapi/browser_file_system_helper.cc
+++ b/content/browser/fileapi/browser_file_system_helper.cc
@@ -63,12 +63,12 @@
           BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get(),
           file_task_runner.get()));
 
-  // Setting up additional mount point providers.
-  ScopedVector<fileapi::FileSystemBackend> additional_providers;
+  // Setting up additional filesystem backends.
+  ScopedVector<fileapi::FileSystemBackend> additional_backends;
   GetContentClient()->browser()->GetAdditionalFileSystemBackends(
       browser_context,
       profile_path,
-      &additional_providers);
+      &additional_backends);
 
   scoped_refptr<fileapi::FileSystemContext> file_system_context =
       new fileapi::FileSystemContext(
@@ -76,7 +76,7 @@
           BrowserContext::GetMountPoints(browser_context),
           browser_context->GetSpecialStoragePolicy(),
           quota_manager_proxy,
-          additional_providers.Pass(),
+          additional_backends.Pass(),
           profile_path,
           CreateBrowserFileSystemOptions(is_incognito));
 
@@ -104,9 +104,7 @@
     return false;
   }
 
-  fileapi::FileSystemBackend* mount_point_provider =
-      context->GetFileSystemBackend(url.type());
-  if (!mount_point_provider) {
+  if (!context->GetFileSystemBackend(url.type())) {
     *error = base::PLATFORM_FILE_ERROR_INVALID_URL;
     return false;
   }
diff --git a/content/browser/renderer_host/input/web_input_event_builders_win.cc b/content/browser/renderer_host/input/web_input_event_builders_win.cc
index b529bf5..6e693a7 100644
--- a/content/browser/renderer_host/input/web_input_event_builders_win.cc
+++ b/content/browser/renderer_host/input/web_input_event_builders_win.cc
@@ -255,14 +255,14 @@
   // This differs slightly from the WebKit code in WebKit/win/WebView.cpp
   // where their original code looks buggy.
   static int last_click_position_x;
-  static int last_click_position_Y;
+  static int last_click_position_y;
   static WebMouseEvent::Button last_click_button = WebMouseEvent::ButtonLeft;
 
   double current_time = result.timeStampSeconds;
   bool cancel_previous_click =
       (abs(last_click_position_x - result.x) >
           (::GetSystemMetrics(SM_CXDOUBLECLK) / 2))
-      || (abs(last_click_position_x - result.y) >
+      || (abs(last_click_position_y - result.y) >
           (::GetSystemMetrics(SM_CYDOUBLECLK) / 2))
       || ((current_time - g_last_click_time) * 1000.0 > ::GetDoubleClickTime());
 
@@ -272,7 +272,7 @@
     } else {
       g_last_click_count = 1;
       last_click_position_x = result.x;
-      last_click_position_x = result.y;
+      last_click_position_y = result.y;
     }
     g_last_click_time = current_time;
     last_click_button = result.button;
@@ -281,7 +281,7 @@
     if (cancel_previous_click) {
       g_last_click_count = 0;
       last_click_position_x = 0;
-      last_click_position_x = 0;
+      last_click_position_y = 0;
       g_last_click_time = 0;
     }
   }
diff --git a/content/browser/renderer_host/media/midi_host.cc b/content/browser/renderer_host/media/midi_host.cc
index 116511f..aeb481c 100644
--- a/content/browser/renderer_host/media/midi_host.cc
+++ b/content/browser/renderer_host/media/midi_host.cc
@@ -26,7 +26,7 @@
 
 MIDIHost::~MIDIHost() {
   if (midi_manager_)
-    midi_manager_->ReleaseAccess(this);
+    midi_manager_->EndSession(this);
 }
 
 void MIDIHost::OnChannelClosing() {
@@ -45,7 +45,7 @@
                                  bool* message_was_ok) {
   bool handled = true;
   IPC_BEGIN_MESSAGE_MAP_EX(MIDIHost, message, *message_was_ok)
-    IPC_MESSAGE_HANDLER(MIDIHostMsg_RequestAccess, OnRequestAccess)
+    IPC_MESSAGE_HANDLER(MIDIHostMsg_StartSession, OnStartSession)
     IPC_MESSAGE_HANDLER(MIDIHostMsg_SendData, OnSendData)
     IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP_EX()
@@ -53,24 +53,23 @@
   return handled;
 }
 
-void MIDIHost::OnRequestAccess(int client_id, int access) {
+void MIDIHost::OnStartSession(int client_id) {
   MIDIPortInfoList input_ports;
   MIDIPortInfoList output_ports;
 
-  // Ask permission and register to receive MIDI data.
-  bool approved = false;
+  // Initialize devices and register to receive MIDI data.
+  bool success = false;
   if (midi_manager_) {
-    approved = midi_manager_->RequestAccess(this, access);
-    if (approved) {
+    success = midi_manager_->StartSession(this);
+    if (success) {
       input_ports = midi_manager_->input_ports();
       output_ports = midi_manager_->output_ports();
     }
   }
 
-  Send(new MIDIMsg_AccessApproved(
+  Send(new MIDIMsg_SessionStarted(
        client_id,
-       access,
-       approved,
+       success,
        input_ports,
        output_ports));
 }
diff --git a/content/browser/renderer_host/media/midi_host.h b/content/browser/renderer_host/media/midi_host.h
index e46ed53..db9d937 100644
--- a/content/browser/renderer_host/media/midi_host.h
+++ b/content/browser/renderer_host/media/midi_host.h
@@ -38,8 +38,8 @@
       size_t length,
       double timestamp) OVERRIDE;
 
-  // Request access to MIDI hardware.
-  void OnRequestAccess(int client_id, int access);
+  // Start session to access MIDI hardware.
+  void OnStartSession(int client_id);
 
   // Data to be sent to a MIDI output port.
   void OnSendData(int port,
diff --git a/content/browser/renderer_host/overscroll_configuration.cc b/content/browser/renderer_host/overscroll_configuration.cc
index 8d35269..77585e5 100644
--- a/content/browser/renderer_host/overscroll_configuration.cc
+++ b/content/browser/renderer_host/overscroll_configuration.cc
@@ -11,7 +11,8 @@
 float g_horiz_threshold_complete = 0.25f;
 float g_vert_threshold_complete = 0.20f;
 
-float g_min_threshold_start = 50.f;
+float g_horiz_threshold_start = 50.f;
+float g_vert_threshold_start = 0.f;
 
 float g_horiz_resist_after = 30.f;
 float g_vert_resist_after = 30.f;
@@ -30,8 +31,12 @@
       g_vert_threshold_complete = value;
       break;
 
-    case OVERSCROLL_CONFIG_MIN_THRESHOLD_START:
-      g_min_threshold_start = value;
+    case OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START:
+      g_horiz_threshold_start = value;
+      break;
+
+    case OVERSCROLL_CONFIG_VERT_THRESHOLD_START:
+      g_vert_threshold_start = value;
       break;
 
     case OVERSCROLL_CONFIG_HORIZ_RESIST_AFTER:
@@ -56,8 +61,11 @@
     case OVERSCROLL_CONFIG_VERT_THRESHOLD_COMPLETE:
       return g_vert_threshold_complete;
 
-    case OVERSCROLL_CONFIG_MIN_THRESHOLD_START:
-      return g_min_threshold_start;
+    case OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START:
+      return g_horiz_threshold_start;
+
+    case OVERSCROLL_CONFIG_VERT_THRESHOLD_START:
+      return g_vert_threshold_start;
 
     case OVERSCROLL_CONFIG_HORIZ_RESIST_AFTER:
       return g_horiz_resist_after;
diff --git a/content/browser/renderer_host/overscroll_controller.cc b/content/browser/renderer_host/overscroll_controller.cc
index 37f9e37..3fed4c3 100644
--- a/content/browser/renderer_host/overscroll_controller.cc
+++ b/content/browser/renderer_host/overscroll_controller.cc
@@ -277,14 +277,16 @@
 }
 
 void OverscrollController::ProcessOverscroll(float delta_x, float delta_y) {
-  if (scroll_state_ == STATE_CONTENT_SCROLLING)
-    return;
-  overscroll_delta_x_ += delta_x;
+  if (scroll_state_ != STATE_CONTENT_SCROLLING)
+    overscroll_delta_x_ += delta_x;
   overscroll_delta_y_ += delta_y;
 
-  float threshold = GetOverscrollConfig(OVERSCROLL_CONFIG_MIN_THRESHOLD_START);
-  if (fabs(overscroll_delta_x_) < threshold &&
-      fabs(overscroll_delta_y_) < threshold) {
+  float horiz_threshold = GetOverscrollConfig(
+      OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START);
+  float vert_threshold = GetOverscrollConfig(
+      OVERSCROLL_CONFIG_VERT_THRESHOLD_START);
+  if (fabs(overscroll_delta_x_) <= horiz_threshold &&
+      fabs(overscroll_delta_y_) <= vert_threshold) {
     SetOverscrollMode(OVERSCROLL_NONE);
     return;
   }
@@ -294,17 +296,20 @@
   // to make sure that subsequent scroll events go through to the page first.
   OverscrollMode new_mode = OVERSCROLL_NONE;
   const float kMinRatio = 2.5;
-  if (fabs(overscroll_delta_x_) > fabs(overscroll_delta_y_) * kMinRatio)
+  if (fabs(overscroll_delta_x_) > horiz_threshold &&
+      fabs(overscroll_delta_x_) > fabs(overscroll_delta_y_) * kMinRatio)
     new_mode = overscroll_delta_x_ > 0.f ? OVERSCROLL_EAST : OVERSCROLL_WEST;
-  else if (fabs(overscroll_delta_y_) > fabs(overscroll_delta_x_) * kMinRatio)
+  else if (fabs(overscroll_delta_y_) > vert_threshold &&
+           fabs(overscroll_delta_y_) > fabs(overscroll_delta_x_) * kMinRatio)
     new_mode = overscroll_delta_y_ > 0.f ? OVERSCROLL_SOUTH : OVERSCROLL_NORTH;
 
-  if (overscroll_mode_ == OVERSCROLL_NONE) {
+  if (overscroll_mode_ == OVERSCROLL_NONE)
     SetOverscrollMode(new_mode);
-  } else if (new_mode != overscroll_mode_) {
+  else if (new_mode != overscroll_mode_)
     SetOverscrollMode(OVERSCROLL_NONE);
+
+  if (overscroll_mode_ == OVERSCROLL_NONE)
     return;
-  }
 
   // Tell the delegate about the overscroll update so that it can update
   // the display accordingly (e.g. show history preview etc.).
@@ -312,21 +317,21 @@
     // Do not include the threshold amount when sending the deltas to the
     // delegate.
     float delegate_delta_x = overscroll_delta_x_;
-    if (fabs(delegate_delta_x) > threshold) {
+    if (fabs(delegate_delta_x) > horiz_threshold) {
       if (delegate_delta_x < 0)
-        delegate_delta_x += threshold;
+        delegate_delta_x += horiz_threshold;
       else
-        delegate_delta_x -= threshold;
+        delegate_delta_x -= horiz_threshold;
     } else {
       delegate_delta_x = 0.f;
     }
 
     float delegate_delta_y = overscroll_delta_y_;
-    if (fabs(delegate_delta_y) > threshold) {
+    if (fabs(delegate_delta_y) > vert_threshold) {
       if (delegate_delta_y < 0)
-        delegate_delta_y += threshold;
+        delegate_delta_y += vert_threshold;
       else
-        delegate_delta_y -= threshold;
+        delegate_delta_y -= vert_threshold;
     } else {
       delegate_delta_y = 0.f;
     }
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc
index 5853786..d804e8d 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -3154,8 +3154,8 @@
   process_->sink().ClearMessages();
 
   // Simulate wheel events.
-  SimulateWheelEvent(0, -5, 0, true);  // sent directly
-  SimulateWheelEvent(0, -1, 0, true);  // enqueued
+  SimulateWheelEvent(-5, 0, 0, true);  // sent directly
+  SimulateWheelEvent(-1, 1, 0, true);  // enqueued
   SimulateWheelEvent(-10, -3, 0, true);  // coalesced into previous event
   SimulateWheelEvent(-15, -1, 0, true);  // coalesced into previous event
   SimulateWheelEvent(-30, -3, 0, true);  // coalesced into previous event
@@ -3182,8 +3182,8 @@
                     INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
   EXPECT_EQ(OVERSCROLL_WEST, host_->overscroll_mode());
   EXPECT_EQ(OVERSCROLL_WEST, host_->overscroll_delegate()->current_mode());
-  EXPECT_EQ(-75.f, host_->overscroll_delta_x());
-  EXPECT_EQ(-25.f, host_->overscroll_delegate()->delta_x());
+  EXPECT_EQ(-81.f, host_->overscroll_delta_x());
+  EXPECT_EQ(-31.f, host_->overscroll_delegate()->delta_x());
   EXPECT_EQ(0.f, host_->overscroll_delegate()->delta_y());
   EXPECT_EQ(0U, process_->sink().message_count());
 
@@ -3194,14 +3194,14 @@
 }
 
 // Tests that if some scroll events are consumed towards the start, then
-// subsequent scrolls do not overscroll.
-TEST_F(RenderWidgetHostTest, WheelScrollConsumedDoNotOverscroll) {
+// subsequent scrolls do not horizontal overscroll.
+TEST_F(RenderWidgetHostTest, WheelScrollConsumedDoNotHorizOverscroll) {
   host_->SetupForOverscrollControllerTest();
   process_->sink().ClearMessages();
 
   // Simulate wheel events.
-  SimulateWheelEvent(0, -5, 0, true);  // sent directly
-  SimulateWheelEvent(0, -1, 0, true);  // enqueued
+  SimulateWheelEvent(-5, 0, 0, true);  // sent directly
+  SimulateWheelEvent(-1, -1, 0, true);  // enqueued
   SimulateWheelEvent(-10, -3, 0, true);  // coalesced into previous event
   SimulateWheelEvent(-15, -1, 0, true);  // coalesced into previous event
   SimulateWheelEvent(-30, -3, 0, true);  // coalesced into previous event
@@ -3225,7 +3225,7 @@
   SendInputEventACK(WebInputEvent::MouseWheel,
                     INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
   EXPECT_EQ(OVERSCROLL_NONE, host_->overscroll_mode());
-  EXPECT_EQ(1U, process_->sink().message_count());
+  EXPECT_EQ(0U, process_->sink().message_count());
 
   process_->sink().ClearMessages();
   SendInputEventACK(WebInputEvent::MouseWheel,
@@ -3269,7 +3269,7 @@
 
   // Send a wheel event. ACK the event as not processed. This should not
   // initiate an overscroll gesture since it doesn't cross the threshold yet.
-  SimulateWheelEvent(10, -5, 0, true);
+  SimulateWheelEvent(10, 0, 0, true);
   EXPECT_EQ(1U, process_->sink().message_count());
   SendInputEventACK(WebInputEvent::MouseWheel,
                     INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
@@ -3278,7 +3278,7 @@
   process_->sink().ClearMessages();
 
   // Scroll some more so as to not overscroll.
-  SimulateWheelEvent(10, -4, 0, true);
+  SimulateWheelEvent(10, 0, 0, true);
   EXPECT_EQ(1U, process_->sink().message_count());
   SendInputEventACK(WebInputEvent::MouseWheel,
                     INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
@@ -3287,7 +3287,7 @@
   process_->sink().ClearMessages();
 
   // Scroll some more to initiate an overscroll.
-  SimulateWheelEvent(40, -4, 0, true);
+  SimulateWheelEvent(40, 0, 0, true);
   EXPECT_EQ(1U, process_->sink().message_count());
   SendInputEventACK(WebInputEvent::MouseWheel,
                     INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
@@ -3299,13 +3299,13 @@
   process_->sink().ClearMessages();
 
   // Scroll in the reverse direction enough to abort the overscroll.
-  SimulateWheelEvent(-20, -4, 0, true);
+  SimulateWheelEvent(-20, 0, 0, true);
   EXPECT_EQ(0U, process_->sink().message_count());
   EXPECT_EQ(OVERSCROLL_NONE, host_->overscroll_mode());
   EXPECT_EQ(OVERSCROLL_NONE, host_->overscroll_delegate()->current_mode());
 
   // Continue to scroll in the reverse direction.
-  SimulateWheelEvent(-20, 4, 0, true);
+  SimulateWheelEvent(-20, 0, 0, true);
   EXPECT_EQ(1U, process_->sink().message_count());
   SendInputEventACK(WebInputEvent::MouseWheel,
                     INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
@@ -3315,7 +3315,7 @@
 
   // Continue to scroll in the reverse direction enough to initiate overscroll
   // in that direction.
-  SimulateWheelEvent(-55, -2, 0, true);
+  SimulateWheelEvent(-55, 0, 0, true);
   EXPECT_EQ(1U, process_->sink().message_count());
   SendInputEventACK(WebInputEvent::MouseWheel,
                     INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
@@ -3332,7 +3332,7 @@
 
   // Send a wheel event. ACK the event as not processed. This should not
   // initiate an overscroll gesture since it doesn't cross the threshold yet.
-  SimulateWheelEvent(10, -5, 0, true);
+  SimulateWheelEvent(10, 0, 0, true);
   EXPECT_EQ(1U, process_->sink().message_count());
   SendInputEventACK(WebInputEvent::MouseWheel,
                     INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
@@ -3341,7 +3341,7 @@
   process_->sink().ClearMessages();
 
   // Scroll some more so as to not overscroll.
-  SimulateWheelEvent(20, -4, 0, true);
+  SimulateWheelEvent(20, 0, 0, true);
   EXPECT_EQ(1U, process_->sink().message_count());
   SendInputEventACK(WebInputEvent::MouseWheel,
                     INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
@@ -3350,7 +3350,7 @@
   process_->sink().ClearMessages();
 
   // Scroll some more to initiate an overscroll.
-  SimulateWheelEvent(30, -4, 0, true);
+  SimulateWheelEvent(30, 0, 0, true);
   EXPECT_EQ(1U, process_->sink().message_count());
   SendInputEventACK(WebInputEvent::MouseWheel,
                     INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
@@ -3379,7 +3379,7 @@
 
   // Send a wheel event. ACK the event as not processed. This should not
   // initiate an overscroll gesture since it doesn't cross the threshold yet.
-  SimulateWheelEvent(10, -5, 0, true);
+  SimulateWheelEvent(10, 0, 0, true);
   EXPECT_EQ(1U, process_->sink().message_count());
   SendInputEventACK(WebInputEvent::MouseWheel,
                     INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
@@ -3388,7 +3388,7 @@
   process_->sink().ClearMessages();
 
   // Scroll some more so as to not overscroll.
-  SimulateWheelEvent(20, -4, 0, true);
+  SimulateWheelEvent(20, 0, 0, true);
   EXPECT_EQ(1U, process_->sink().message_count());
   SendInputEventACK(WebInputEvent::MouseWheel,
                     INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
@@ -3397,7 +3397,7 @@
   process_->sink().ClearMessages();
 
   // Scroll some more to initiate an overscroll.
-  SimulateWheelEvent(30, -4, 0, true);
+  SimulateWheelEvent(30, 0, 0, true);
   EXPECT_EQ(1U, process_->sink().message_count());
   SendInputEventACK(WebInputEvent::MouseWheel,
                     INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
@@ -3496,7 +3496,7 @@
   EXPECT_EQ(55.f, host_->overscroll_delta_x());
   EXPECT_EQ(-5.f, host_->overscroll_delta_y());
   EXPECT_EQ(5.f, host_->overscroll_delegate()->delta_x());
-  EXPECT_EQ(0.f, host_->overscroll_delegate()->delta_y());
+  EXPECT_EQ(-5.f, host_->overscroll_delegate()->delta_y());
   EXPECT_EQ(0U, host_->GestureEventLastQueueEventSize());
   process_->sink().ClearMessages();
 
@@ -3509,7 +3509,7 @@
   EXPECT_EQ(65.f, host_->overscroll_delta_x());
   EXPECT_EQ(-10.f, host_->overscroll_delta_y());
   EXPECT_EQ(15.f, host_->overscroll_delegate()->delta_x());
-  EXPECT_EQ(0.f, host_->overscroll_delegate()->delta_y());
+  EXPECT_EQ(-10.f, host_->overscroll_delegate()->delta_y());
   EXPECT_EQ(0U, process_->sink().message_count());
   EXPECT_EQ(0U, host_->GestureEventLastQueueEventSize());
 
@@ -3525,9 +3525,9 @@
 }
 
 // Tests that if the page is scrolled because of a scroll-gesture, then that
-// particular scroll sequence never generates overscroll, even if there is no
-// content to scroll on the page anymore.
-TEST_F(RenderWidgetHostTest, GestureScrollConsumedDoNotOverscroll) {
+// particular scroll sequence never generates overscroll if the scroll direction
+// is horizontal.
+TEST_F(RenderWidgetHostTest, GestureScrollConsumedHorizontal) {
   // Turn off debounce handling for test isolation.
   host_->SetupForOverscrollControllerTest();
   host_->set_debounce_interval_time_ms(0);
@@ -3535,9 +3535,9 @@
 
   SimulateGestureEvent(WebInputEvent::GestureScrollBegin,
                        WebGestureEvent::Touchscreen);
-  SimulateGestureScrollUpdateEvent(8, -5, 0);
+  SimulateGestureScrollUpdateEvent(10, 0, 0);
 
-  // ACK both events as being processed.
+  // Start scrolling on content. ACK both events as being processed.
   SendInputEventACK(WebInputEvent::GestureScrollBegin,
                     INPUT_EVENT_ACK_STATE_CONSUMED);
   SendInputEventACK(WebInputEvent::GestureScrollUpdate,
@@ -3548,12 +3548,47 @@
   // Send another gesture event and ACK as not being processed. This should
   // not initiate overscroll because the beginning of the scroll event did
   // scroll some content on the page.
-  SimulateGestureScrollUpdateEvent(55, -5, 0);
+  SimulateGestureScrollUpdateEvent(55, 0, 0);
   SendInputEventACK(WebInputEvent::GestureScrollUpdate,
                     INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
   EXPECT_EQ(OVERSCROLL_NONE, host_->overscroll_mode());
 }
 
+// Tests that if the page is scrolled because of a scroll-gesture, then that
+// particular scroll sequence never generates overscroll if the scroll direction
+// is vertical.
+TEST_F(RenderWidgetHostTest, GestureScrollConsumedVertical) {
+  // Turn off debounce handling for test isolation.
+  host_->SetupForOverscrollControllerTest();
+  host_->set_debounce_interval_time_ms(0);
+  process_->sink().ClearMessages();
+
+  SimulateGestureEvent(WebInputEvent::GestureScrollBegin,
+                       WebGestureEvent::Touchscreen);
+  SimulateGestureScrollUpdateEvent(0, -1, 0);
+
+  // Start scrolling on content. ACK both events as being processed.
+  SendInputEventACK(WebInputEvent::GestureScrollBegin,
+                    INPUT_EVENT_ACK_STATE_CONSUMED);
+  SendInputEventACK(WebInputEvent::GestureScrollUpdate,
+                    INPUT_EVENT_ACK_STATE_CONSUMED);
+  EXPECT_EQ(OVERSCROLL_NONE, host_->overscroll_mode());
+  EXPECT_EQ(OVERSCROLL_NONE, host_->overscroll_delegate()->current_mode());
+
+  // Send another gesture event and ACK as not being processed. This should
+  // initiate overscroll because the scroll was in the vertical direction even
+  // though the beginning of the scroll did scroll content.
+  SimulateGestureScrollUpdateEvent(0, -50, 0);
+  SendInputEventACK(WebInputEvent::GestureScrollUpdate,
+                    INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
+  EXPECT_EQ(OVERSCROLL_NORTH, host_->overscroll_mode());
+
+  // Changing direction of scroll to be horizontal to test that this causes the
+  // vertical overscroll to stop.
+  SimulateGestureScrollUpdateEvent(500, 0, 0);
+  EXPECT_EQ(OVERSCROLL_NONE, host_->overscroll_mode());
+}
+
 // Tests that the overscroll controller plays nice with touch-scrolls and the
 // gesture event filter with debounce filtering turned on.
 TEST_F(RenderWidgetHostTest, GestureScrollDebounceOverscrolls) {
@@ -3570,7 +3605,7 @@
                     INPUT_EVENT_ACK_STATE_CONSUMED);
 
   // Send update events.
-  SimulateGestureScrollUpdateEvent(25, -5, 0);
+  SimulateGestureScrollUpdateEvent(25, 0, 0);
   EXPECT_EQ(1U, host_->GestureEventLastQueueEventSize());
   EXPECT_EQ(0U, host_->GestureEventDebouncingQueueSize());
   EXPECT_TRUE(host_->ScrollingInProgress());
@@ -3592,7 +3627,7 @@
   EXPECT_EQ(2U, host_->GestureEventDebouncingQueueSize());
 
   // Send another update event. This should get into the queue.
-  SimulateGestureScrollUpdateEvent(30, 5, 0);
+  SimulateGestureScrollUpdateEvent(30, 0, 0);
   EXPECT_EQ(0U, process_->sink().message_count());
   EXPECT_EQ(2U, host_->GestureEventLastQueueEventSize());
   EXPECT_EQ(0U, host_->GestureEventDebouncingQueueSize());
@@ -3612,7 +3647,7 @@
   process_->sink().ClearMessages();
 
   // Send another update event. This should get into the queue.
-  SimulateGestureScrollUpdateEvent(10, 5, 0);
+  SimulateGestureScrollUpdateEvent(10, 0, 0);
   EXPECT_EQ(0U, process_->sink().message_count());
   EXPECT_EQ(2U, host_->GestureEventLastQueueEventSize());
   EXPECT_EQ(0U, host_->GestureEventDebouncingQueueSize());
@@ -3650,7 +3685,7 @@
                     INPUT_EVENT_ACK_STATE_CONSUMED);
 
   // Send update events.
-  SimulateGestureScrollUpdateEvent(55, -5, 0);
+  SimulateGestureScrollUpdateEvent(55, 0, 0);
   EXPECT_EQ(1U, host_->GestureEventLastQueueEventSize());
   EXPECT_EQ(0U, host_->GestureEventDebouncingQueueSize());
   EXPECT_TRUE(host_->ScrollingInProgress());
@@ -3725,7 +3760,7 @@
 
   SimulateGestureEvent(WebInputEvent::GestureScrollBegin,
                        WebGestureEvent::Touchscreen);
-  SimulateGestureScrollUpdateEvent(20, 4, 0);
+  SimulateGestureScrollUpdateEvent(20, 0, 0);
   SendInputEventACK(WebInputEvent::GestureScrollBegin,
                     INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
   SendInputEventACK(WebInputEvent::GestureScrollUpdate,
@@ -3743,7 +3778,7 @@
 
   SendInputEventACK(WebInputEvent::TouchMove,
                     INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
-  SimulateGestureScrollUpdateEvent(45, 5, 0);
+  SimulateGestureScrollUpdateEvent(45, 0, 0);
   SendInputEventACK(WebInputEvent::GestureScrollUpdate,
                     INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
   EXPECT_EQ(OVERSCROLL_EAST, host_->overscroll_mode());
@@ -3865,7 +3900,7 @@
   EXPECT_EQ(OVERSCROLL_EAST, host_->overscroll_delegate()->current_mode());
   EXPECT_EQ(55.f, host_->overscroll_delta_x());
   EXPECT_EQ(5.f, host_->overscroll_delegate()->delta_x());
-  EXPECT_EQ(0.f, host_->overscroll_delegate()->delta_y());
+  EXPECT_EQ(-5.f, host_->overscroll_delegate()->delta_y());
 
   // Send end event.
   SimulateGestureEvent(WebKit::WebInputEvent::GestureScrollEnd,
@@ -3923,7 +3958,7 @@
   EXPECT_EQ(OVERSCROLL_EAST, host_->overscroll_delegate()->current_mode());
   EXPECT_EQ(235.f, host_->overscroll_delta_x());
   EXPECT_EQ(185.f, host_->overscroll_delegate()->delta_x());
-  EXPECT_EQ(0.f, host_->overscroll_delegate()->delta_y());
+  EXPECT_EQ(-5.f, host_->overscroll_delegate()->delta_y());
 
   // Send end event.
   SimulateGestureEvent(WebKit::WebInputEvent::GestureScrollEnd,
@@ -4028,8 +4063,8 @@
   view_->set_bounds(gfx::Rect(0, 0, 400, 200));
   view_->Show();
 
-  SimulateWheelEvent(0, -5, 0, true);  // sent directly
-  SimulateWheelEvent(0, -1, 0, true);  // enqueued
+  SimulateWheelEvent(5, 0, 0, true);  // sent directly
+  SimulateWheelEvent(-1, 0, 0, true);  // enqueued
   SimulateWheelEvent(-10, -3, 0, true);  // coalesced into previous event
   SimulateWheelEvent(-15, -1, 0, true);  // coalesced into previous event
   SimulateWheelEvent(-30, -3, 0, true);  // coalesced into previous event
@@ -4146,9 +4181,9 @@
   EXPECT_TRUE(host_->ScrollStateIsUnknown());
   EXPECT_EQ(0U, process_->sink().message_count());
 
-  SimulateWheelEvent(0, -5, 0, true);  // sent directly
-  SimulateWheelEvent(-60, -1, 0, true);  // enqueued
-  SimulateWheelEvent(-100, -3, 0, true);  // coalesced into previous event
+  SimulateWheelEvent(-5, 0, 0, true);  // sent directly
+  SimulateWheelEvent(-60, 0, 0, true);  // enqueued
+  SimulateWheelEvent(-100, 0, 0, true);  // coalesced into previous event
   EXPECT_EQ(1U, process_->sink().message_count());
   EXPECT_TRUE(host_->ScrollStateIsUnknown());
   process_->sink().ClearMessages();
diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc
index a5e1aa1..ec092d2 100644
--- a/content/browser/storage_partition_impl.cc
+++ b/content/browser/storage_partition_impl.cc
@@ -26,233 +26,132 @@
 
 namespace {
 
-int GenerateQuotaClientMask(uint32 remove_mask) {
-  int quota_client_mask = 0;
-
-  if (remove_mask & StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS)
-    quota_client_mask |= quota::QuotaClient::kFileSystem;
-  if (remove_mask & StoragePartition::REMOVE_DATA_MASK_WEBSQL)
-    quota_client_mask |= quota::QuotaClient::kDatabase;
-  if (remove_mask & StoragePartition::REMOVE_DATA_MASK_APPCACHE)
-    quota_client_mask |= quota::QuotaClient::kAppcache;
-  if (remove_mask & StoragePartition::REMOVE_DATA_MASK_INDEXEDDB)
-    quota_client_mask |= quota::QuotaClient::kIndexedDatabase;
-
-  return quota_client_mask;
+void DoNothingStatusCallback(quota::QuotaStatusCode status) {
+  // Do nothing.
 }
 
-void OnClearedCookies(const base::Closure& callback, int num_deleted) {
-  // The final callback needs to happen from UI thread.
-  if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
-    BrowserThread::PostTask(
-        BrowserThread::UI, FROM_HERE,
-        base::Bind(&OnClearedCookies, callback, num_deleted));
-    return;
-  }
-
-  callback.Run();
-}
-
-void ClearCookiesOnIOThread(
-    const scoped_refptr<net::URLRequestContextGetter>& rq_context,
-    const base::Time begin,
-    const base::Time end,
-    const base::Closure& callback) {
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-  net::CookieStore* cookie_store = rq_context->
-      GetURLRequestContext()->cookie_store();
-  cookie_store->DeleteAllCreatedBetweenAsync(begin, end,
-      base::Bind(&OnClearedCookies, callback));
-}
-
-void OnQuotaManagedOriginDeleted(const GURL& origin,
-                                 quota::StorageType type,
-                                 size_t* origins_to_delete_count,
-                                 const base::Closure& callback,
-                                 quota::QuotaStatusCode status) {
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-  DCHECK_GT(*origins_to_delete_count, 0u);
-  if (status != quota::kQuotaStatusOk) {
-    DLOG(ERROR) << "Couldn't remove data of type " << type << " for origin "
-                << origin << ". Status: " << status;
-  }
-
-  (*origins_to_delete_count)--;
-  if (*origins_to_delete_count == 0) {
-    delete origins_to_delete_count;
-    callback.Run();
-  }
-}
-
-void ClearQuotaManagedOriginsOnIOThread(quota::QuotaManager* quota_manager,
-                                        uint32 remove_mask,
-                                        const base::Closure& callback,
-                                        const std::set<GURL>& origins,
-                                        quota::StorageType quota_storage_type) {
+void ClearQuotaManagedOriginsOnIOThread(
+    const scoped_refptr<quota::QuotaManager>& quota_manager,
+    const std::set<GURL>& origins,
+    quota::StorageType quota_storage_type) {
   // The QuotaManager manages all storage other than cookies, LocalStorage,
   // and SessionStorage. This loop wipes out most HTML5 storage for the given
   // origins.
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-
-  if (!origins.size()) {
-    // No origins to clear.
-    callback.Run();
-    return;
-  }
-
   std::set<GURL>::const_iterator origin;
-  size_t* origins_to_delete_count = new size_t(origins.size());
   for (std::set<GURL>::const_iterator origin = origins.begin();
        origin != origins.end(); ++origin) {
-    quota_manager->DeleteOriginData(
-        *origin, quota_storage_type,
-        GenerateQuotaClientMask(remove_mask),
-        base::Bind(&OnQuotaManagedOriginDeleted,
-                   origin->GetOrigin(), quota_storage_type,
-                   origins_to_delete_count, callback));
+    quota_manager->DeleteOriginData(*origin, quota_storage_type,
+                                    quota::QuotaClient::kAllClientsMask,
+                                    base::Bind(&DoNothingStatusCallback));
   }
 }
 
-void ClearShaderCacheOnIOThread(const base::FilePath& path,
-                                const base::Time begin,
-                                const base::Time end,
-                                const base::Closure& callback) {
+void ClearOriginOnIOThread(
+    uint32 storage_mask,
+    const GURL& storage_origin,
+    const scoped_refptr<net::URLRequestContextGetter>& request_context,
+    const scoped_refptr<quota::QuotaManager>& quota_manager) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-  ShaderCacheFactory::GetInstance()->ClearByPath(path, begin, end, callback);
+
+  if (storage_mask & StoragePartition::kCookies) {
+    // Handle the cookies.
+    net::CookieMonster* cookie_monster =
+        request_context->GetURLRequestContext()->cookie_store()->
+            GetCookieMonster();
+    if (cookie_monster)
+      cookie_monster->DeleteAllForHostAsync(
+          storage_origin, net::CookieMonster::DeleteCallback());
+  }
+
+  // Handle all HTML5 storage other than DOMStorageContext.
+  std::set<GURL> origins;
+  origins.insert(storage_origin);
+  if (storage_mask & StoragePartition::kQuotaManagedTemporaryStorage) {
+    ClearQuotaManagedOriginsOnIOThread(quota_manager,
+                                       origins,
+                                       quota::kStorageTypeTemporary);
+  }
+  if (storage_mask & StoragePartition::kQuotaManagedPersistentStorage) {
+    ClearQuotaManagedOriginsOnIOThread(quota_manager,
+                                       origins,
+                                       quota::kStorageTypePersistent);
+  }
+  if (storage_mask & StoragePartition::kQuotaManagedSyncableStorage) {
+    ClearQuotaManagedOriginsOnIOThread(quota_manager,
+                                       origins,
+                                       quota::kStorageTypeSyncable);
+  }
+}
+
+void ClearAllDataOnIOThread(
+    uint32 storage_mask,
+    const scoped_refptr<net::URLRequestContextGetter>& request_context,
+    const scoped_refptr<quota::QuotaManager>& quota_manager) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+
+  if (storage_mask & StoragePartition::kCookies) {
+    // Handle the cookies.
+    net::CookieMonster* cookie_monster =
+        request_context->GetURLRequestContext()->cookie_store()->
+            GetCookieMonster();
+    if (cookie_monster)
+      cookie_monster->DeleteAllAsync(net::CookieMonster::DeleteCallback());
+  }
+
+  // Handle all HTML5 storage other than DOMStorageContext.
+  if (storage_mask & StoragePartition::kQuotaManagedTemporaryStorage) {
+    quota_manager->GetOriginsModifiedSince(
+        quota::kStorageTypeTemporary, base::Time(),
+        base::Bind(&ClearQuotaManagedOriginsOnIOThread, quota_manager));
+  }
+  if (storage_mask & StoragePartition::kQuotaManagedPersistentStorage) {
+    quota_manager->GetOriginsModifiedSince(
+        quota::kStorageTypePersistent, base::Time(),
+        base::Bind(&ClearQuotaManagedOriginsOnIOThread, quota_manager));
+  }
+  if (storage_mask & StoragePartition::kQuotaManagedSyncableStorage) {
+    quota_manager->GetOriginsModifiedSince(
+        quota::kStorageTypeSyncable, base::Time(),
+        base::Bind(&ClearQuotaManagedOriginsOnIOThread, quota_manager));
+  }
+}
+
+void ClearedShaderCacheOnIOThread(base::Closure callback) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+  BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback);
+}
+
+void ClearShaderCacheOnIOThread(base::FilePath path,
+    base::Time begin, base::Time end, base::Closure callback) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+  ShaderCacheFactory::GetInstance()->ClearByPath(
+      path, begin, end,
+      base::Bind(&ClearedShaderCacheOnIOThread, callback));
 }
 
 void OnLocalStorageUsageInfo(
     const scoped_refptr<DOMStorageContextImpl>& dom_storage_context,
-    const base::Time delete_begin,
-    const base::Time delete_end,
-    const base::Closure& callback,
     const std::vector<dom_storage::LocalStorageUsageInfo>& infos) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
 
   for (size_t i = 0; i < infos.size(); ++i) {
-    if (infos[i].last_modified >= delete_begin &&
-        infos[i].last_modified <= delete_end) {
-      dom_storage_context->DeleteLocalStorage(infos[i].origin);
-    }
+    dom_storage_context->DeleteLocalStorage(infos[i].origin);
   }
-  callback.Run();
 }
 
 void OnSessionStorageUsageInfo(
     const scoped_refptr<DOMStorageContextImpl>& dom_storage_context,
-    const base::Closure& callback,
     const std::vector<dom_storage::SessionStorageUsageInfo>& infos) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
 
-  for (size_t i = 0; i < infos.size(); ++i)
+  for (size_t i = 0; i < infos.size(); ++i) {
     dom_storage_context->DeleteSessionStorage(infos[i]);
-
-  callback.Run();
-}
-
-void ClearLocalStorageOnUIThread(
-    const scoped_refptr<DOMStorageContextImpl>& dom_storage_context,
-    const GURL& remove_origin,
-    const base::Time begin,
-    const base::Time end,
-    const base::Closure& callback) {
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-
-  if (!remove_origin.is_empty()) {
-    dom_storage_context->DeleteLocalStorage(remove_origin);
-    callback.Run();
-    return;
   }
-
-  dom_storage_context->GetLocalStorageUsage(
-      base::Bind(&OnLocalStorageUsageInfo,
-                 dom_storage_context, begin, end, callback));
-}
-
-void ClearSessionStorageOnUIThread(
-    const scoped_refptr<DOMStorageContextImpl>& dom_storage_context,
-    const base::Closure& callback) {
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-
-  dom_storage_context->GetSessionStorageUsage(
-      base::Bind(&OnSessionStorageUsageInfo, dom_storage_context, callback));
 }
 
 }  // namespace
 
-// Helper for deleting quota managed data from a partition.
-//
-// Most of the operations in this class are done on IO thread.
-struct StoragePartitionImpl::QuotaManagedDataDeletionHelper {
-  QuotaManagedDataDeletionHelper(const base::Closure& callback)
-      : callback(callback), task_count(0) {
-  }
-
-  void IncrementTaskCountOnIO();
-  void DecrementTaskCountOnIO();
-
-  void ClearDataOnIOThread(
-      const scoped_refptr<quota::QuotaManager>& quota_manager,
-      const base::Time begin,
-      uint32 remove_mask,
-      uint32 quota_storage_remove_mask,
-      const GURL& remove_origin);
-
-  // Accessed on IO thread.
-  const base::Closure callback;
-  // Accessed on IO thread.
-  int task_count;
-};
-
-// Helper for deleting all sorts of data from a partition, keeps track of
-// deletion status.
-//
-// StoragePartitionImpl creates an instance of this class to keep track of
-// data deletion progress. Deletion requires deleting multiple bits of data
-// (e.g. cookies, local storage, session storage etc.) and hopping between UI
-// and IO thread. An instance of this class is created in the beginning of
-// deletion process (StoragePartitionImpl::ClearDataImpl) and the instance is
-// forwarded and updated on each (sub) deletion's callback. The instance is
-// finally destroyed when deletion completes (and |callback| is invoked).
-struct StoragePartitionImpl::DataDeletionHelper {
-  DataDeletionHelper(const base::Closure& callback)
-      : callback(callback), task_count(0) {
-  }
-
-  void IncrementTaskCountOnUI();
-  void DecrementTaskCountOnUI();
-
-  void ClearDataOnUIThread(uint32 remove_mask,
-                           uint32 quota_storage_remove_mask,
-                           const GURL& remove_origin,
-                           const base::FilePath& path,
-                           net::URLRequestContextGetter* rq_context,
-                           DOMStorageContextImpl* dom_storage_context,
-                           quota::QuotaManager* quota_manager,
-                           const base::Time begin,
-                           const base::Time end);
-
-  // Accessed on UI thread.
-  const base::Closure callback;
-  // Accessed on UI thread.
-  int task_count;
-};
-
-void ClearQuotaManagedDataOnIOThread(
-    const scoped_refptr<quota::QuotaManager>& quota_manager,
-    const base::Time begin,
-    uint32 remove_mask,
-    uint32 quota_storage_remove_mask,
-    const GURL& remove_origin,
-    const base::Closure& callback) {
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-
-  StoragePartitionImpl::QuotaManagedDataDeletionHelper* helper =
-      new StoragePartitionImpl::QuotaManagedDataDeletionHelper(callback);
-  helper->ClearDataOnIOThread(quota_manager, begin,
-      remove_mask, quota_storage_remove_mask, remove_origin);
-}
-
 StoragePartitionImpl::StoragePartitionImpl(
     const base::FilePath& partition_path,
     quota::QuotaManager* quota_manager,
@@ -394,221 +293,59 @@
   return indexed_db_context_.get();
 }
 
-void StoragePartitionImpl::ClearDataImpl(
-    uint32 remove_mask,
-    uint32 quota_storage_remove_mask,
-    const GURL& remove_origin,
-    net::URLRequestContextGetter* rq_context,
-    const base::Time begin,
-    const base::Time end,
-    const base::Closure& callback) {
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-  DataDeletionHelper* helper = new DataDeletionHelper(callback);
-  // |helper| deletes itself when done in
-  // DataDeletionHelper::DecrementTaskCountOnUI().
-  helper->ClearDataOnUIThread(
-      remove_mask, quota_storage_remove_mask, remove_origin,
-      GetPath(), rq_context, dom_storage_context_, quota_manager_, begin, end);
-}
-
-void StoragePartitionImpl::
-    QuotaManagedDataDeletionHelper::IncrementTaskCountOnIO() {
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-  ++task_count;
-}
-
-void StoragePartitionImpl::
-    QuotaManagedDataDeletionHelper::DecrementTaskCountOnIO() {
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-  DCHECK_GT(task_count, 0);
-  --task_count;
-  if (task_count)
-    return;
-
-  callback.Run();
-  delete this;
-}
-
-void StoragePartitionImpl::QuotaManagedDataDeletionHelper::ClearDataOnIOThread(
-    const scoped_refptr<quota::QuotaManager>& quota_manager,
-    const base::Time begin,
-    uint32 remove_mask,
-    uint32 quota_storage_remove_mask,
-    const GURL& remove_origin) {
-  std::set<GURL> origins;
-  if (!remove_origin.is_empty())
-    origins.insert(remove_origin);
-
-  IncrementTaskCountOnIO();
-  base::Closure decrement_callback = base::Bind(
-      &QuotaManagedDataDeletionHelper::DecrementTaskCountOnIO,
-      base::Unretained(this));
-
-  if (quota_storage_remove_mask & kQuotaManagedPersistentStorage) {
-    IncrementTaskCountOnIO();
-    if (origins.empty()) {  // Remove for all origins.
-      // Ask the QuotaManager for all origins with temporary quota modified
-      // within the user-specified timeframe, and deal with the resulting set in
-      // ClearQuotaManagedOriginsOnIOThread().
-      quota_manager->GetOriginsModifiedSince(
-          quota::kStorageTypePersistent, begin,
-          base::Bind(&ClearQuotaManagedOriginsOnIOThread,
-                     quota_manager, remove_mask, decrement_callback));
-    } else {
-      ClearQuotaManagedOriginsOnIOThread(
-          quota_manager, remove_mask, decrement_callback,
-          origins, quota::kStorageTypePersistent);
-    }
-  }
-
-  // Do the same for temporary quota.
-  if (quota_storage_remove_mask & kQuotaManagedTemporaryStorage) {
-    IncrementTaskCountOnIO();
-    if (origins.empty()) {  // Remove for all origins.
-      quota_manager->GetOriginsModifiedSince(
-          quota::kStorageTypeTemporary, begin,
-          base::Bind(&ClearQuotaManagedOriginsOnIOThread,
-                     quota_manager, remove_mask, decrement_callback));
-    } else {
-      ClearQuotaManagedOriginsOnIOThread(
-          quota_manager, remove_mask, decrement_callback,
-          origins, quota::kStorageTypeTemporary);
-    }
-  }
-
-  // Do the same for syncable quota.
-  if (quota_storage_remove_mask & kQuotaManagedSyncableStorage) {
-    IncrementTaskCountOnIO();
-    if (origins.empty()) {  // Remove for all origins.
-      quota_manager->GetOriginsModifiedSince(
-          quota::kStorageTypeSyncable, begin,
-          base::Bind(&ClearQuotaManagedOriginsOnIOThread,
-                     quota_manager, remove_mask, decrement_callback));
-    } else {
-      ClearQuotaManagedOriginsOnIOThread(
-          quota_manager, remove_mask, decrement_callback,
-          origins, quota::kStorageTypeSyncable);
-    }
-  }
-
-  DecrementTaskCountOnIO();
-}
-
-void StoragePartitionImpl::DataDeletionHelper::IncrementTaskCountOnUI() {
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-  ++task_count;
-}
-
-void StoragePartitionImpl::DataDeletionHelper::DecrementTaskCountOnUI() {
-  if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
-    BrowserThread::PostTask(
-        BrowserThread::UI, FROM_HERE,
-        base::Bind(&DataDeletionHelper::DecrementTaskCountOnUI,
-                   base::Unretained(this)));
-    return;
-  }
-  DCHECK_GT(task_count, 0);
-  --task_count;
-  if (!task_count) {
-    callback.Run();
-    delete this;
-  }
-}
-
-void StoragePartitionImpl::DataDeletionHelper::ClearDataOnUIThread(
-    uint32 remove_mask,
-    uint32 quota_storage_remove_mask,
-    const GURL& remove_origin,
-    const base::FilePath& path,
-    net::URLRequestContextGetter* rq_context,
-    DOMStorageContextImpl* dom_storage_context,
-    quota::QuotaManager* quota_manager,
-    const base::Time begin,
-    const base::Time end) {
-  DCHECK_NE(remove_mask, 0u);
-  DCHECK(!callback.is_null());
-
-  IncrementTaskCountOnUI();
-  base::Closure decrement_callback = base::Bind(
-      &DataDeletionHelper::DecrementTaskCountOnUI, base::Unretained(this));
-
-  if (remove_mask & REMOVE_DATA_MASK_COOKIES) {
-    // Handle the cookies.
-    IncrementTaskCountOnUI();
-    BrowserThread::PostTask(
-        BrowserThread::IO, FROM_HERE,
-        base::Bind(&ClearCookiesOnIOThread,
-                   make_scoped_refptr(rq_context), begin, end,
-                   decrement_callback));
-  }
-
-  if (remove_mask & REMOVE_DATA_MASK_INDEXEDDB ||
-      remove_mask & REMOVE_DATA_MASK_WEBSQL ||
-      remove_mask & REMOVE_DATA_MASK_APPCACHE ||
-      remove_mask & REMOVE_DATA_MASK_FILE_SYSTEMS) {
-    IncrementTaskCountOnUI();
-    BrowserThread::PostTask(
-        BrowserThread::IO, FROM_HERE,
-        base::Bind(&ClearQuotaManagedDataOnIOThread,
-                   make_scoped_refptr(quota_manager), begin,
-                   remove_mask, quota_storage_remove_mask, remove_origin,
-                   decrement_callback));
-  }
-
-  if (remove_mask & REMOVE_DATA_MASK_LOCAL_STORAGE) {
-    IncrementTaskCountOnUI();
-    ClearLocalStorageOnUIThread(
-        make_scoped_refptr(dom_storage_context),
-        remove_origin, begin, end, decrement_callback);
-
-    // ClearDataImpl cannot clear session storage data when a particular origin
-    // is specified. Therefore we ignore clearing session storage in this case.
-    // TODO(lazyboy): Fix.
-    if (remove_origin.is_empty()) {
-      IncrementTaskCountOnUI();
-      ClearSessionStorageOnUIThread(
-          make_scoped_refptr(dom_storage_context), decrement_callback);
-    }
-  }
-
-  if (remove_mask & REMOVE_DATA_MASK_SHADER_CACHE) {
-    IncrementTaskCountOnUI();
-    BrowserThread::PostTask(
-        BrowserThread::IO, FROM_HERE,
-        base::Bind(&ClearShaderCacheOnIOThread,
-                   path, begin, end, decrement_callback));
-  }
-
-  DecrementTaskCountOnUI();
-}
-
-
-void StoragePartitionImpl::ClearDataForOrigin(
-    uint32 remove_mask,
-    uint32 quota_storage_remove_mask,
+void StoragePartitionImpl::AsyncClearDataForOrigin(
+    uint32 storage_mask,
     const GURL& storage_origin,
     net::URLRequestContextGetter* request_context_getter) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-  ClearDataImpl(remove_mask, quota_storage_remove_mask, storage_origin,
-                request_context_getter, base::Time(), base::Time::Max(),
-                base::Bind(&base::DoNothing));
+
+  BrowserThread::PostTask(
+      BrowserThread::IO, FROM_HERE,
+      base::Bind(&ClearOriginOnIOThread,
+                 storage_mask,
+                 storage_origin,
+                 make_scoped_refptr(request_context_getter),
+                 quota_manager_));
+
+  if (storage_mask & kLocalDomStorage)
+    GetDOMStorageContext()->DeleteLocalStorage(storage_origin);
 }
 
-void StoragePartitionImpl::ClearDataForUnboundedRange(
-    uint32 remove_mask,
-    uint32 quota_storage_remove_mask) {
-  ClearDataImpl(remove_mask, quota_storage_remove_mask, GURL(),
-                GetURLRequestContext(), base::Time(), base::Time::Max(),
-                base::Bind(&base::DoNothing));
+void StoragePartitionImpl::AsyncClearData(uint32 storage_mask) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+  // We ignore the media request context because it shares the same cookie store
+  // as the main request context.
+  BrowserThread::PostTask(
+      BrowserThread::IO, FROM_HERE,
+      base::Bind(&ClearAllDataOnIOThread,
+                 storage_mask,
+                 url_request_context_,
+                 quota_manager_));
+
+  if (storage_mask & kLocalDomStorage) {
+    dom_storage_context_->GetLocalStorageUsage(
+        base::Bind(&OnLocalStorageUsageInfo, dom_storage_context_));
+  }
+
+  if (storage_mask & kSessionDomStorage) {
+    dom_storage_context_->GetSessionStorageUsage(
+        base::Bind(&OnSessionStorageUsageInfo, dom_storage_context_));
+  }
 }
 
-void StoragePartitionImpl::ClearDataForRange(uint32 remove_mask,
-                                             uint32 quota_storage_remove_mask,
-                                             const base::Time& begin,
-                                             const base::Time& end,
-                                             const base::Closure& callback) {
-  ClearDataImpl(remove_mask, quota_storage_remove_mask, GURL(),
-                GetURLRequestContext(), begin, end, callback);
+void StoragePartitionImpl::AsyncClearDataBetween(uint32 storage_mask,
+      const base::Time& begin, const base::Time& end,
+      const base::Closure& callback) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+  DCHECK(storage_mask == kShaderStorage);
+
+  if (storage_mask & kShaderStorage) {
+    BrowserThread::PostTask(
+        BrowserThread::IO, FROM_HERE,
+        base::Bind(&ClearShaderCacheOnIOThread, GetPath(), begin, end,
+            callback));
+  }
 }
 
 WebRTCIdentityStore* StoragePartitionImpl::GetWebRTCIdentityStore() {
diff --git a/content/browser/storage_partition_impl.h b/content/browser/storage_partition_impl.h
index 0410f4d..9dcdfec 100644
--- a/content/browser/storage_partition_impl.h
+++ b/content/browser/storage_partition_impl.h
@@ -31,26 +31,19 @@
   virtual webkit_database::DatabaseTracker* GetDatabaseTracker() OVERRIDE;
   virtual DOMStorageContextImpl* GetDOMStorageContext() OVERRIDE;
   virtual IndexedDBContextImpl* GetIndexedDBContext() OVERRIDE;
-
-  virtual void ClearDataForOrigin(
-      uint32 remove_mask,
-      uint32 quota_storage_remove_mask,
+  virtual void AsyncClearDataForOrigin(
+      uint32 storage_mask,
       const GURL& storage_origin,
       net::URLRequestContextGetter* request_context_getter) OVERRIDE;
-  virtual void ClearDataForUnboundedRange(
-      uint32 remove_mask,
-      uint32 quota_storage_remove_mask) OVERRIDE;
-  virtual void ClearDataForRange(uint32 remove_mask,
-                                 uint32 quota_storage_remove_mask,
-                                 const base::Time& begin,
-                                 const base::Time& end,
-                                 const base::Closure& callback) OVERRIDE;
+  virtual void AsyncClearData(uint32 storage_mask) OVERRIDE;
+  virtual void AsyncClearDataBetween(
+      uint32 storage_mask,
+      const base::Time& begin,
+      const base::Time& end,
+      const base::Closure& callback) OVERRIDE;
 
   WebRTCIdentityStore* GetWebRTCIdentityStore();
 
-  struct DataDeletionHelper;
-  struct QuotaManagedDataDeletionHelper;
-
  private:
   friend class StoragePartitionImplMap;
   FRIEND_TEST_ALL_PREFIXES(StoragePartitionShaderClearTest, ClearShaderCache);
@@ -65,10 +58,6 @@
                                       bool in_memory,
                                       const base::FilePath& profile_path);
 
-  // Quota managed data uses a different bitmask for types than
-  // StoragePartition uses. This method generates that mask.
-  static int GenerateQuotaClientMask(uint32 remove_mask);
-
   CONTENT_EXPORT StoragePartitionImpl(
       const base::FilePath& partition_path,
       quota::QuotaManager* quota_manager,
@@ -79,14 +68,6 @@
       IndexedDBContextImpl* indexed_db_context,
       scoped_ptr<WebRTCIdentityStore> webrtc_identity_store);
 
-  void ClearDataImpl(uint32 remove_mask,
-                     uint32 quota_storage_remove_mask,
-                     const GURL& remove_origin,
-                     net::URLRequestContextGetter* rq_context,
-                     const base::Time begin,
-                     const base::Time end,
-                     const base::Closure& callback);
-
   // Used by StoragePartitionImplMap.
   //
   // TODO(ajwong): These should be taken in the constructor and in Create() but
diff --git a/content/browser/storage_partition_impl_map.cc b/content/browser/storage_partition_impl_map.cc
index da7e88f..8b6556e 100644
--- a/content/browser/storage_partition_impl_map.cc
+++ b/content/browser/storage_partition_impl_map.cc
@@ -496,9 +496,7 @@
        ++it) {
     const StoragePartitionConfig& config = it->first;
     if (config.partition_domain == partition_domain) {
-      it->second->ClearDataForUnboundedRange(
-          StoragePartition::REMOVE_DATA_MASK_ALL,
-          StoragePartition::kAllStorage);
+      it->second->AsyncClearData(StoragePartition::kAllStorage);
       if (!config.in_memory) {
         paths_to_keep.push_back(it->second->GetPath());
       }
diff --git a/content/browser/storage_partition_impl_unittest.cc b/content/browser/storage_partition_impl_unittest.cc
index 0492335..36af638 100644
--- a/content/browser/storage_partition_impl_unittest.cc
+++ b/content/browser/storage_partition_impl_unittest.cc
@@ -98,10 +98,8 @@
 void ClearData(content::StoragePartitionImpl* sp,
                const base::Closure& cb) {
   base::Time time;
-  sp->ClearDataForRange(
-      StoragePartition::REMOVE_DATA_MASK_SHADER_CACHE,
-      StoragePartition::kAllStorage,
-      time, time, cb);
+  sp->AsyncClearDataBetween(content::StoragePartition::kShaderStorage,
+                           time, time, cb);
 }
 
 TEST_F(StoragePartitionShaderClearTest, ClearShaderCache) {
diff --git a/content/browser/web_contents/aura/window_slider.cc b/content/browser/web_contents/aura/window_slider.cc
index 8b94cd0..7afd32d 100644
--- a/content/browser/web_contents/aura/window_slider.cc
+++ b/content/browser/web_contents/aura/window_slider.cc
@@ -58,8 +58,8 @@
       owner_(owner),
       delta_x_(0.f),
       weak_factory_(this),
-      min_start_threshold_(content::GetOverscrollConfig(
-          content::OVERSCROLL_CONFIG_MIN_THRESHOLD_START)),
+      horiz_start_threshold_(content::GetOverscrollConfig(
+          content::OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START)),
       complete_threshold_(content::GetOverscrollConfig(
           content::OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE)) {
   event_window_->AddPreTargetHandler(this);
@@ -89,7 +89,7 @@
 }
 
 bool WindowSlider::IsSlideInProgress() const {
-  return fabs(delta_x_) >= min_start_threshold_ || slider_.get() ||
+  return fabs(delta_x_) >= horiz_start_threshold_ || slider_.get() ||
       weak_factory_.HasWeakPtrs();
 }
 
@@ -107,7 +107,7 @@
 void WindowSlider::UpdateForScroll(float x_offset, float y_offset) {
   float old_delta = delta_x_;
   delta_x_ += x_offset;
-  if (fabs(delta_x_) < min_start_threshold_ && !slider_.get())
+  if (fabs(delta_x_) < horiz_start_threshold_ && !slider_.get())
     return;
 
   if ((old_delta < 0 && delta_x_ > 0) ||
@@ -127,13 +127,13 @@
     SetupSliderLayer();
   }
 
-  if (delta_x_ <= -min_start_threshold_) {
+  if (delta_x_ <= -horiz_start_threshold_) {
     translate = owner_->bounds().width() +
-        std::max(delta_x_ + min_start_threshold_,
+        std::max(delta_x_ + horiz_start_threshold_,
                  static_cast<float>(-owner_->bounds().width()));
     translate_layer = slider_.get();
-  } else if (delta_x_ >= min_start_threshold_) {
-    translate = std::min(delta_x_ - min_start_threshold_,
+  } else if (delta_x_ >= horiz_start_threshold_) {
+    translate = std::min(delta_x_ - horiz_start_threshold_,
                          static_cast<float>(owner_->bounds().width()));
     translate_layer = owner_->layer();
   } else {
@@ -153,7 +153,7 @@
     return;
 
   int width = owner_->bounds().width();
-  float ratio = (fabs(delta_x_) - min_start_threshold_) / width;
+  float ratio = (fabs(delta_x_) - horiz_start_threshold_) / width;
   if (ratio < complete_threshold_) {
     ResetScroll();
     return;
diff --git a/content/browser/web_contents/aura/window_slider.h b/content/browser/web_contents/aura/window_slider.h
index 03ec2df..227ad1b 100644
--- a/content/browser/web_contents/aura/window_slider.h
+++ b/content/browser/web_contents/aura/window_slider.h
@@ -120,7 +120,7 @@
 
   base::WeakPtrFactory<WindowSlider> weak_factory_;
 
-  const float min_start_threshold_;
+  const float horiz_start_threshold_;
   const float complete_threshold_;
 
   DISALLOW_COPY_AND_ASSIGN(WindowSlider);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 71dc1df..fe34bc0 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -73,12 +73,12 @@
 #include "content/public/common/bindings_policy.h"
 #include "content/public/common/content_constants.h"
 #include "content/public/common/content_switches.h"
+#include "content/public/common/page_zoom.h"
 #include "content/public/common/url_constants.h"
 #include "net/base/mime_util.h"
 #include "net/base/net_util.h"
 #include "net/base/network_change_notifier.h"
 #include "net/url_request/url_request_context_getter.h"
-#include "third_party/WebKit/public/web/WebView.h"
 #include "ui/base/layout.h"
 #include "ui/base/touch/touch_device.h"
 #include "ui/base/ui_base_switches.h"
@@ -2053,7 +2053,7 @@
   // Calculate the zoom percent from the factor. Round up to the nearest whole
   // number.
   int percent = static_cast<int>(
-      WebKit::WebView::zoomLevelToZoomFactor(GetZoomLevel()) * 100 + 0.5);
+      ZoomLevelToZoomFactor(GetZoomLevel()) * 100 + 0.5);
   *enable_decrement = percent > minimum_zoom_percent_;
   *enable_increment = percent < maximum_zoom_percent_;
   return percent;
diff --git a/content/child/browser_font_resource_trusted.cc b/content/child/browser_font_resource_trusted.cc
new file mode 100644
index 0000000..d31ede0
--- /dev/null
+++ b/content/child/browser_font_resource_trusted.cc
@@ -0,0 +1,428 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/child/browser_font_resource_trusted.h"
+
+#include "base/strings/string_util.h"
+#include "base/strings/utf_string_conversions.h"
+#include "ppapi/c/dev/ppb_font_dev.h"
+#include "ppapi/proxy/connection.h"
+#include "ppapi/shared_impl/ppapi_preferences.h"
+#include "ppapi/shared_impl/var.h"
+#include "ppapi/thunk/enter.h"
+#include "ppapi/thunk/ppb_image_data_api.h"
+#include "ppapi/thunk/thunk.h"
+#include "skia/ext/platform_canvas.h"
+#include "third_party/WebKit/public/platform/WebCanvas.h"
+#include "third_party/WebKit/public/platform/WebFloatPoint.h"
+#include "third_party/WebKit/public/platform/WebFloatRect.h"
+#include "third_party/WebKit/public/platform/WebRect.h"
+#include "third_party/WebKit/public/web/WebFont.h"
+#include "third_party/WebKit/public/web/WebFontDescription.h"
+#include "third_party/WebKit/public/web/WebTextRun.h"
+#include "third_party/icu/source/common/unicode/ubidi.h"
+#include "third_party/skia/include/core/SkRect.h"
+
+using ppapi::StringVar;
+using ppapi::thunk::EnterResourceNoLock;
+using ppapi::thunk::PPB_ImageData_API;
+using WebKit::WebFloatPoint;
+using WebKit::WebFloatRect;
+using WebKit::WebFont;
+using WebKit::WebFontDescription;
+using WebKit::WebRect;
+using WebKit::WebTextRun;
+using WebKit::WebCanvas;
+
+namespace content {
+
+namespace {
+
+// Same as WebPreferences::kCommonScript. I'd use that directly here, but get an
+// undefined reference linker error.
+const char kCommonScript[] = "Zyyy";
+
+string16 GetFontFromMap(
+    const webkit_glue::ScriptFontFamilyMap& map,
+    const std::string& script) {
+  webkit_glue::ScriptFontFamilyMap::const_iterator it =
+      map.find(script);
+  if (it != map.end())
+    return it->second;
+  return string16();
+}
+
+// Splits a PP_BrowserFont_Trusted_TextRun into a sequence or LTR and RTL
+// WebTextRuns that can be used for WebKit. Normally WebKit does this for us,
+// but the font drawing and measurement routines we call happen after this
+// step. So for correct rendering of RTL content, we need to do it ourselves.
+class TextRunCollection {
+ public:
+  explicit TextRunCollection(const PP_BrowserFont_Trusted_TextRun& run)
+      : bidi_(NULL),
+        num_runs_(0) {
+    StringVar* text_string = StringVar::FromPPVar(run.text);
+    if (!text_string)
+      return;  // Leave num_runs_ = 0 so we'll do nothing.
+    text_ = UTF8ToUTF16(text_string->value());
+
+    if (run.override_direction) {
+      // Skip autodetection.
+      num_runs_ = 1;
+      override_run_ = WebTextRun(text_, PP_ToBool(run.rtl), true);
+    } else {
+      bidi_ = ubidi_open();
+      UErrorCode uerror = U_ZERO_ERROR;
+      ubidi_setPara(bidi_, text_.data(), text_.size(), run.rtl, NULL, &uerror);
+      if (U_SUCCESS(uerror))
+        num_runs_ = ubidi_countRuns(bidi_, &uerror);
+    }
+  }
+
+  ~TextRunCollection() {
+    if (bidi_)
+      ubidi_close(bidi_);
+  }
+
+  const string16& text() const { return text_; }
+  int num_runs() const { return num_runs_; }
+
+  // Returns a WebTextRun with the info for the run at the given index.
+  // The range covered by the run is in the two output params.
+  WebTextRun GetRunAt(int index, int32_t* run_start, int32_t* run_len) const {
+    DCHECK(index < num_runs_);
+    if (bidi_) {
+      bool run_rtl = !!ubidi_getVisualRun(bidi_, index, run_start, run_len);
+      return WebTextRun(string16(&text_[*run_start], *run_len),
+                        run_rtl, true);
+    }
+
+    // Override run, return the single one.
+    DCHECK(index == 0);
+    *run_start = 0;
+    *run_len = static_cast<int32_t>(text_.size());
+    return override_run_;
+  }
+
+ private:
+  // Will be null if we skipped autodetection.
+  UBiDi* bidi_;
+
+  // Text of all the runs.
+  string16 text_;
+
+  int num_runs_;
+
+  // When the content specifies override_direction (bidi_ is null) then this
+  // will contain the single text run for WebKit.
+  WebTextRun override_run_;
+
+  DISALLOW_COPY_AND_ASSIGN(TextRunCollection);
+};
+
+bool PPTextRunToWebTextRun(const PP_BrowserFont_Trusted_TextRun& text,
+                           WebTextRun* run) {
+  StringVar* text_string = StringVar::FromPPVar(text.text);
+  if (!text_string)
+    return false;
+
+  *run = WebTextRun(UTF8ToUTF16(text_string->value()),
+                    PP_ToBool(text.rtl),
+                    PP_ToBool(text.override_direction));
+  return true;
+}
+
+// The PP_* version lacks "None", so is just one value shifted from the
+// WebFontDescription version. These values are checked in
+// PPFontDescToWebFontDesc to make sure the conversion is correct. This is a
+// macro so it can also be used in the COMPILE_ASSERTS.
+#define PP_FAMILY_TO_WEB_FAMILY(f) \
+  static_cast<WebFontDescription::GenericFamily>(f + 1)
+
+// Assumes the given PP_FontDescription has been validated.
+WebFontDescription PPFontDescToWebFontDesc(
+    const PP_BrowserFont_Trusted_Description& font,
+    const ppapi::Preferences& prefs) {
+  // Verify that the enums match so we can just static cast.
+  COMPILE_ASSERT(static_cast<int>(WebFontDescription::Weight100) ==
+                 static_cast<int>(PP_BROWSERFONT_TRUSTED_WEIGHT_100),
+                 FontWeight100);
+  COMPILE_ASSERT(static_cast<int>(WebFontDescription::Weight900) ==
+                 static_cast<int>(PP_BROWSERFONT_TRUSTED_WEIGHT_900),
+                 FontWeight900);
+  COMPILE_ASSERT(WebFontDescription::GenericFamilyStandard ==
+                 PP_FAMILY_TO_WEB_FAMILY(PP_FONTFAMILY_DEFAULT),
+                 StandardFamily);
+  COMPILE_ASSERT(WebFontDescription::GenericFamilySerif ==
+                 PP_FAMILY_TO_WEB_FAMILY(PP_FONTFAMILY_SERIF),
+                 SerifFamily);
+  COMPILE_ASSERT(WebFontDescription::GenericFamilySansSerif ==
+                 PP_FAMILY_TO_WEB_FAMILY(PP_FONTFAMILY_SANSSERIF),
+                 SansSerifFamily);
+  COMPILE_ASSERT(WebFontDescription::GenericFamilyMonospace ==
+                 PP_FAMILY_TO_WEB_FAMILY(PP_FONTFAMILY_MONOSPACE),
+                 MonospaceFamily);
+
+  StringVar* face_name = StringVar::FromPPVar(font.face);  // Possibly null.
+
+  WebFontDescription result;
+  string16 resolved_family;
+  if (!face_name || face_name->value().empty()) {
+    // Resolve the generic family.
+    switch (font.family) {
+      case PP_BROWSERFONT_TRUSTED_FAMILY_SERIF:
+        resolved_family = GetFontFromMap(prefs.serif_font_family_map,
+                                         kCommonScript);
+        break;
+      case PP_BROWSERFONT_TRUSTED_FAMILY_SANSSERIF:
+        resolved_family = GetFontFromMap(prefs.sans_serif_font_family_map,
+                                         kCommonScript);
+        break;
+      case PP_BROWSERFONT_TRUSTED_FAMILY_MONOSPACE:
+        resolved_family = GetFontFromMap(prefs.fixed_font_family_map,
+                                         kCommonScript);
+        break;
+      case PP_BROWSERFONT_TRUSTED_FAMILY_DEFAULT:
+      default:
+        resolved_family = GetFontFromMap(prefs.standard_font_family_map,
+                                         kCommonScript);
+        break;
+    }
+  } else {
+    // Use the exact font.
+    resolved_family = UTF8ToUTF16(face_name->value());
+  }
+  result.family = resolved_family;
+
+  result.genericFamily = PP_FAMILY_TO_WEB_FAMILY(font.family);
+
+  if (font.size == 0) {
+    // Resolve the default font size, using the resolved family to see if
+    // we should use the fixed or regular font size. It's difficult at this
+    // level to detect if the requested font is fixed width, so we only apply
+    // the alternate font size to the default fixed font family.
+    if (StringToLowerASCII(resolved_family) ==
+        StringToLowerASCII(GetFontFromMap(prefs.fixed_font_family_map,
+                                          kCommonScript)))
+      result.size = static_cast<float>(prefs.default_fixed_font_size);
+    else
+      result.size = static_cast<float>(prefs.default_font_size);
+  } else {
+    // Use the exact size.
+    result.size = static_cast<float>(font.size);
+  }
+
+  result.italic = font.italic != PP_FALSE;
+  result.smallCaps = font.small_caps != PP_FALSE;
+  result.weight = static_cast<WebFontDescription::Weight>(font.weight);
+  result.letterSpacing = static_cast<short>(font.letter_spacing);
+  result.wordSpacing = static_cast<short>(font.word_spacing);
+  return result;
+}
+
+}  // namespace
+
+// static
+bool BrowserFontResource_Trusted::IsPPFontDescriptionValid(
+    const PP_BrowserFont_Trusted_Description& desc) {
+  // Check validity of string. We can't check the actual text since we could
+  // be on the wrong thread and don't know if we're in the plugin or the host.
+  if (desc.face.type != PP_VARTYPE_STRING &&
+      desc.face.type != PP_VARTYPE_UNDEFINED)
+    return false;
+
+  // Check enum ranges.
+  if (static_cast<int>(desc.family) < PP_BROWSERFONT_TRUSTED_FAMILY_DEFAULT ||
+      static_cast<int>(desc.family) > PP_BROWSERFONT_TRUSTED_FAMILY_MONOSPACE)
+    return false;
+  if (static_cast<int>(desc.weight) < PP_BROWSERFONT_TRUSTED_WEIGHT_100 ||
+      static_cast<int>(desc.weight) > PP_BROWSERFONT_TRUSTED_WEIGHT_900)
+    return false;
+
+  // Check for excessive sizes which may cause layout to get confused.
+  if (desc.size > 200)
+    return false;
+
+  return true;
+}
+
+BrowserFontResource_Trusted::BrowserFontResource_Trusted(
+    ppapi::proxy::Connection connection,
+    PP_Instance instance,
+    const PP_BrowserFont_Trusted_Description& desc,
+    const ppapi::Preferences& prefs)
+    : PluginResource(connection, instance),
+      font_(WebFont::create(PPFontDescToWebFontDesc(desc, prefs))) {
+}
+
+BrowserFontResource_Trusted::~BrowserFontResource_Trusted() {
+}
+
+ppapi::thunk::PPB_BrowserFont_Trusted_API*
+BrowserFontResource_Trusted::AsPPB_BrowserFont_Trusted_API() {
+  return this;
+}
+
+PP_Bool BrowserFontResource_Trusted::Describe(
+    PP_BrowserFont_Trusted_Description* description,
+    PP_BrowserFont_Trusted_Metrics* metrics) {
+  if (description->face.type != PP_VARTYPE_UNDEFINED)
+    return PP_FALSE;
+
+  // While converting the other way in PPFontDescToWebFontDesc we validated
+  // that the enums can be casted.
+  WebFontDescription web_desc = font_->fontDescription();
+  description->face = StringVar::StringToPPVar(UTF16ToUTF8(web_desc.family));
+  description->family =
+      static_cast<PP_BrowserFont_Trusted_Family>(web_desc.genericFamily);
+  description->size = static_cast<uint32_t>(web_desc.size);
+  description->weight = static_cast<PP_BrowserFont_Trusted_Weight>(
+      web_desc.weight);
+  description->italic = web_desc.italic ? PP_TRUE : PP_FALSE;
+  description->small_caps = web_desc.smallCaps ? PP_TRUE : PP_FALSE;
+  description->letter_spacing = static_cast<int32_t>(web_desc.letterSpacing);
+  description->word_spacing = static_cast<int32_t>(web_desc.wordSpacing);
+
+  metrics->height = font_->height();
+  metrics->ascent = font_->ascent();
+  metrics->descent = font_->descent();
+  metrics->line_spacing = font_->lineSpacing();
+  metrics->x_height = static_cast<int32_t>(font_->xHeight());
+
+  // Convert the string.
+  return PP_TRUE;
+}
+
+PP_Bool BrowserFontResource_Trusted::DrawTextAt(
+    PP_Resource image_data,
+    const PP_BrowserFont_Trusted_TextRun* text,
+    const PP_Point* position,
+    uint32_t color,
+    const PP_Rect* clip,
+    PP_Bool image_data_is_opaque) {
+  PP_Bool result = PP_FALSE;
+  // Get and map the image data we're painting to.
+  EnterResourceNoLock<PPB_ImageData_API> enter(image_data, true);
+  if (enter.failed())
+    return result;
+
+  PPB_ImageData_API* image = static_cast<PPB_ImageData_API*>(
+      enter.object());
+  SkCanvas* canvas = image->GetPlatformCanvas();
+  bool needs_unmapping = false;
+  if (!canvas) {
+    needs_unmapping = true;
+    image->Map();
+    canvas = image->GetPlatformCanvas();
+    if (!canvas)
+      return result;  // Failure mapping.
+  }
+
+  DrawTextToCanvas(canvas, *text, position, color, clip, image_data_is_opaque);
+
+  if (needs_unmapping)
+    image->Unmap();
+  return PP_TRUE;
+}
+
+int32_t BrowserFontResource_Trusted::MeasureText(
+    const PP_BrowserFont_Trusted_TextRun* text) {
+  WebTextRun run;
+  if (!PPTextRunToWebTextRun(*text, &run))
+    return -1;
+  return font_->calculateWidth(run);
+}
+
+uint32_t BrowserFontResource_Trusted::CharacterOffsetForPixel(
+    const PP_BrowserFont_Trusted_TextRun* text,
+    int32_t pixel_position) {
+  TextRunCollection runs(*text);
+  int32_t cur_pixel_offset = 0;
+  for (int i = 0; i < runs.num_runs(); i++) {
+    int32_t run_begin = 0;
+    int32_t run_len = 0;
+    WebTextRun run = runs.GetRunAt(i, &run_begin, &run_len);
+    int run_width = font_->calculateWidth(run);
+    if (pixel_position < cur_pixel_offset + run_width) {
+      // Offset is in this run.
+      return static_cast<uint32_t>(font_->offsetForPosition(
+              run, static_cast<float>(pixel_position - cur_pixel_offset))) +
+          run_begin;
+    }
+    cur_pixel_offset += run_width;
+  }
+  return runs.text().size();
+}
+
+int32_t BrowserFontResource_Trusted::PixelOffsetForCharacter(
+    const PP_BrowserFont_Trusted_TextRun* text,
+    uint32_t char_offset) {
+  TextRunCollection runs(*text);
+  int32_t cur_pixel_offset = 0;
+  for (int i = 0; i < runs.num_runs(); i++) {
+    int32_t run_begin = 0;
+    int32_t run_len = 0;
+    WebTextRun run = runs.GetRunAt(i, &run_begin, &run_len);
+    if (char_offset >= static_cast<uint32_t>(run_begin) &&
+        char_offset < static_cast<uint32_t>(run_begin + run_len)) {
+      // Character we're looking for is in this run.
+      //
+      // Here we ask WebKit to give us the rectangle around the character in
+      // question, and then return the left edge. If we asked for a range of
+      // 0 characters starting at the character in question, it would give us
+      // a 0-width rect around the insertion point. But that will be on the
+      // right side of the character for an RTL run, which would be wrong.
+      WebFloatRect rect = font_->selectionRectForText(
+          run, WebFloatPoint(0.0f, 0.0f), font_->height(),
+          char_offset - run_begin, char_offset - run_begin + 1);
+      return cur_pixel_offset + static_cast<int>(rect.x);
+    } else {
+      // Character is past this run, account for the pixels and continue
+      // looking.
+      cur_pixel_offset += font_->calculateWidth(run);
+    }
+  }
+  return -1;  // Requested a char beyond the end.
+}
+
+void BrowserFontResource_Trusted::DrawTextToCanvas(
+    SkCanvas* destination,
+    const PP_BrowserFont_Trusted_TextRun& text,
+    const PP_Point* position,
+    uint32_t color,
+    const PP_Rect* clip,
+    PP_Bool image_data_is_opaque) {
+  // Convert position and clip.
+  WebFloatPoint web_position(static_cast<float>(position->x),
+                             static_cast<float>(position->y));
+  WebRect web_clip;
+  if (!clip) {
+    // Use entire canvas. SkCanvas doesn't have a size on it, so we just use
+    // the current clip bounds.
+    SkRect skclip;
+    destination->getClipBounds(&skclip);
+    web_clip = WebRect(skclip.fLeft, skclip.fTop, skclip.fRight - skclip.fLeft,
+                       skclip.fBottom - skclip.fTop);
+  } else {
+    web_clip = WebRect(clip->point.x, clip->point.y,
+                       clip->size.width, clip->size.height);
+  }
+
+  TextRunCollection runs(text);
+  for (int i = 0; i < runs.num_runs(); i++) {
+    int32_t run_begin = 0;
+    int32_t run_len = 0;
+    WebTextRun run = runs.GetRunAt(i, &run_begin, &run_len);
+    font_->drawText(destination, run, web_position, color, web_clip,
+                    PP_ToBool(image_data_is_opaque));
+
+    // Advance to the next run. Note that we avoid doing this for the last run
+    // since it's unnecessary, measuring text is slow, and most of the time
+    // there will be only one run anyway.
+    if (i != runs.num_runs() - 1)
+      web_position.x += font_->calculateWidth(run);
+  }
+}
+
+}  // namespace content
diff --git a/content/child/browser_font_resource_trusted.h b/content/child/browser_font_resource_trusted.h
new file mode 100644
index 0000000..23a4344
--- /dev/null
+++ b/content/child/browser_font_resource_trusted.h
@@ -0,0 +1,82 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_CHILD_BROWSER_FONT_RESOURCE_TRUSTED_H_
+#define CONTENT_CHILD_BROWSER_FONT_RESOURCE_TRUSTED_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "ppapi/c/pp_bool.h"
+#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/pp_resource.h"
+#include "ppapi/c/pp_stdint.h"
+#include "ppapi/proxy/plugin_resource.h"
+#include "ppapi/shared_impl/ppapi_preferences.h"
+#include "ppapi/thunk/ppb_browser_font_trusted_api.h"
+
+class SkCanvas;
+
+namespace WebKit {
+class WebFont;
+}
+
+namespace content {
+
+class BrowserFontResource_Trusted
+    : public ppapi::proxy::PluginResource,
+      public ppapi::thunk::PPB_BrowserFont_Trusted_API {
+ public:
+  BrowserFontResource_Trusted(ppapi::proxy::Connection connection,
+                              PP_Instance instance,
+                              const PP_BrowserFont_Trusted_Description& desc,
+                              const ppapi::Preferences& prefs);
+
+  // Validates the parameters in thee description. Can be called on any thread.
+  static bool IsPPFontDescriptionValid(
+      const PP_BrowserFont_Trusted_Description& desc);
+
+  // Resource override.
+  virtual ::ppapi::thunk::PPB_BrowserFont_Trusted_API*
+      AsPPB_BrowserFont_Trusted_API() OVERRIDE;
+
+  // PPB_BrowserFont_Trusted_API implementation.
+  virtual PP_Bool Describe(PP_BrowserFont_Trusted_Description* description,
+                           PP_BrowserFont_Trusted_Metrics* metrics) OVERRIDE;
+  virtual PP_Bool DrawTextAt(PP_Resource image_data,
+                             const PP_BrowserFont_Trusted_TextRun* text,
+                             const PP_Point* position,
+                             uint32_t color,
+                             const PP_Rect* clip,
+                             PP_Bool image_data_is_opaque) OVERRIDE;
+  virtual int32_t MeasureText(
+      const PP_BrowserFont_Trusted_TextRun* text) OVERRIDE;
+  virtual uint32_t CharacterOffsetForPixel(
+      const PP_BrowserFont_Trusted_TextRun* text,
+      int32_t pixel_position) OVERRIDE;
+  virtual int32_t PixelOffsetForCharacter(
+      const PP_BrowserFont_Trusted_TextRun* text,
+      uint32_t char_offset) OVERRIDE;
+
+ private:
+  virtual ~BrowserFontResource_Trusted();
+
+  // Internal version of DrawTextAt that takes a mapped PlatformCanvas.
+  void DrawTextToCanvas(SkCanvas* destination,
+                        const PP_BrowserFont_Trusted_TextRun& text,
+                        const PP_Point* position,
+                        uint32_t color,
+                        const PP_Rect* clip,
+                        PP_Bool image_data_is_opaque);
+
+ private:
+  scoped_ptr<WebKit::WebFont> font_;
+
+  DISALLOW_COPY_AND_ASSIGN(BrowserFontResource_Trusted);
+};
+
+}  // namespace content
+
+#endif  // CONTENT_CHILD_BROWSER_FONT_RESOURCE_TRUSTED_H_
diff --git a/content/child/child_process.cc b/content/child/child_process.cc
index 68eef19..837ab02 100644
--- a/content/child/child_process.cc
+++ b/content/child/child_process.cc
@@ -11,7 +11,7 @@
 #include "base/lazy_instance.h"
 #include "base/message_loop/message_loop.h"
 #include "base/metrics/statistics_recorder.h"
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/threading/thread.h"
diff --git a/content/child/child_thread.cc b/content/child/child_thread.cc
index 16bfae2..eefa4c5 100644
--- a/content/child/child_thread.cc
+++ b/content/child/child_thread.cc
@@ -9,8 +9,8 @@
 #include "base/command_line.h"
 #include "base/lazy_instance.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
+#include "base/process/process_handle.h"
 #include "base/strings/string_util.h"
 #include "base/threading/thread_local.h"
 #include "base/tracked_objects.h"
diff --git a/content/child/fileapi/file_system_dispatcher.cc b/content/child/fileapi/file_system_dispatcher.cc
index 5c7d7c9..f2ba527 100644
--- a/content/child/fileapi/file_system_dispatcher.cc
+++ b/content/child/fileapi/file_system_dispatcher.cc
@@ -6,7 +6,7 @@
 
 #include "base/callback.h"
 #include "base/file_util.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/child/child_thread.h"
 #include "content/common/fileapi/file_system_messages.h"
 
diff --git a/content/child/fileapi/file_system_dispatcher.h b/content/child/fileapi/file_system_dispatcher.h
index a8fc624..4a8ced4 100644
--- a/content/child/fileapi/file_system_dispatcher.h
+++ b/content/child/fileapi/file_system_dispatcher.h
@@ -11,7 +11,7 @@
 #include "base/basictypes.h"
 #include "base/callback_forward.h"
 #include "base/id_map.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "ipc/ipc_listener.h"
 #include "ipc/ipc_platform_file.h"
 #include "webkit/common/fileapi/file_system_types.h"
diff --git a/content/child/npapi/np_channel_base.h b/content/child/npapi/np_channel_base.h
index f0a9466..4b5a369 100644
--- a/content/child/npapi/np_channel_base.h
+++ b/content/child/npapi/np_channel_base.h
@@ -11,7 +11,7 @@
 #include "base/containers/hash_tables.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/child/npapi/npobject_base.h"
 #include "content/common/message_router.h"
 #include "ipc/ipc_channel_handle.h"
diff --git a/content/child/npapi/webplugin_delegate_impl.cc b/content/child/npapi/webplugin_delegate_impl.cc
index f05d59d..b7334aa 100644
--- a/content/child/npapi/webplugin_delegate_impl.cc
+++ b/content/child/npapi/webplugin_delegate_impl.cc
@@ -9,7 +9,7 @@
 
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
 #include "base/strings/string_util.h"
 #include "content/child/npapi/plugin_instance.h"
 #include "content/child/npapi/plugin_lib.h"
diff --git a/content/child/resource_dispatcher_unittest.cc b/content/child/resource_dispatcher_unittest.cc
index 2959c08..6b5eb40 100644
--- a/content/child/resource_dispatcher_unittest.cc
+++ b/content/child/resource_dispatcher_unittest.cc
@@ -7,8 +7,8 @@
 
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process.h"
-#include "base/process_util.h"
+#include "base/process/process.h"
+#include "base/process/process_handle.h"
 #include "content/child/request_extra_data.h"
 #include "content/child/resource_dispatcher.h"
 #include "content/common/resource_messages.h"
diff --git a/content/child/socket_stream_dispatcher.cc b/content/child/socket_stream_dispatcher.cc
index 9997f35..87f299f 100644
--- a/content/child/socket_stream_dispatcher.cc
+++ b/content/child/socket_stream_dispatcher.cc
@@ -19,8 +19,8 @@
 #include "content/common/socket_stream_messages.h"
 #include "net/base/net_errors.h"
 #include "url/gurl.h"
+#include "webkit/child/websocketstreamhandle_bridge.h"
 #include "webkit/child/websocketstreamhandle_delegate.h"
-#include "webkit/glue/websocketstreamhandle_bridge.h"
 
 namespace content {
 
diff --git a/content/common/android/surface_texture_peer.h b/content/common/android/surface_texture_peer.h
index 0e1fbcc..9be032d 100644
--- a/content/common/android/surface_texture_peer.h
+++ b/content/common/android/surface_texture_peer.h
@@ -5,7 +5,7 @@
 #ifndef CONTENT_COMMON_ANDROID_SURFACE_TEXTURE_PEER_H_
 #define CONTENT_COMMON_ANDROID_SURFACE_TEXTURE_PEER_H_
 
-#include "base/process.h"
+#include "base/process/process.h"
 #include "ui/gl/android/surface_texture_bridge.h"
 
 namespace content {
diff --git a/content/common/browser_plugin/browser_plugin_messages.h b/content/common/browser_plugin/browser_plugin_messages.h
index a91f92f..5c921ac 100644
--- a/content/common/browser_plugin/browser_plugin_messages.h
+++ b/content/common/browser_plugin/browser_plugin_messages.h
@@ -8,7 +8,7 @@
 
 #include "base/basictypes.h"
 #include "base/memory/shared_memory.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/values.h"
 #include "cc/output/compositor_frame.h"
 #include "cc/output/compositor_frame_ack.h"
@@ -312,18 +312,6 @@
 IPC_MESSAGE_CONTROL1(BrowserPluginMsg_GuestGone,
                      int /* instance_id */)
 
-// When the guest is unresponsive, the browser process informs the embedder
-// through this message.
-IPC_MESSAGE_CONTROL2(BrowserPluginMsg_GuestUnresponsive,
-                     int /* instance_id */,
-                     int /* process_id */)
-
-// When the guest begins responding again, the browser process informs the
-// embedder through this message.
-IPC_MESSAGE_CONTROL2(BrowserPluginMsg_GuestResponsive,
-                     int /* instance_id */,
-                     int /* process_id */)
-
 // When the user tabs to the end of the tab stops of a guest, the browser
 // process informs the embedder to tab out of the browser plugin.
 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_AdvanceFocus,
diff --git a/content/common/child_process_host_impl.cc b/content/common/child_process_host_impl.cc
index 2dfab2f..8b022e5 100644
--- a/content/common/child_process_host_impl.cc
+++ b/content/common/child_process_host_impl.cc
@@ -12,7 +12,7 @@
 #include "base/logging.h"
 #include "base/metrics/histogram.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/process_metrics.h"
 #include "base/rand_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc
index c220e2a..1056939 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.cc
+++ b/content/common/gpu/client/command_buffer_proxy_impl.cc
@@ -8,7 +8,6 @@
 #include "base/debug/trace_event.h"
 #include "base/logging.h"
 #include "base/memory/shared_memory.h"
-#include "base/process_util.h"
 #include "base/stl_util.h"
 #include "content/common/child_process_messages.h"
 #include "content/common/gpu/client/gpu_channel_host.h"
diff --git a/content/common/gpu/client/gpu_channel_host.h b/content/common/gpu/client/gpu_channel_host.h
index c06989d..6decd17 100644
--- a/content/common/gpu/client/gpu_channel_host.h
+++ b/content/common/gpu/client/gpu_channel_host.h
@@ -13,8 +13,7 @@
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/weak_ptr.h"
-#include "base/process.h"
-#include "base/process_util.h"
+#include "base/process/process.h"
 #include "base/synchronization/lock.h"
 #include "content/common/content_export.h"
 #include "content/common/gpu/gpu_process_launch_causes.h"
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index d00b670..5fe111e 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -15,7 +15,6 @@
 #include "base/command_line.h"
 #include "base/debug/trace_event.h"
 #include "base/message_loop/message_loop_proxy.h"
-#include "base/process_util.h"
 #include "base/rand_util.h"
 #include "base/strings/string_util.h"
 #include "base/timer/timer.h"
diff --git a/content/common/gpu/gpu_channel.h b/content/common/gpu/gpu_channel.h
index 854a859..8d775f0 100644
--- a/content/common/gpu/gpu_channel.h
+++ b/content/common/gpu/gpu_channel.h
@@ -12,7 +12,7 @@
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/weak_ptr.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "build/build_config.h"
 #include "content/common/gpu/gpu_command_buffer_stub.h"
 #include "content/common/gpu/gpu_memory_manager.h"
diff --git a/content/common/gpu/gpu_memory_manager.cc b/content/common/gpu/gpu_memory_manager.cc
index ee2b2b6..21d5163 100644
--- a/content/common/gpu/gpu_memory_manager.cc
+++ b/content/common/gpu/gpu_memory_manager.cc
@@ -10,7 +10,7 @@
 #include "base/command_line.h"
 #include "base/debug/trace_event.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
 #include "base/strings/string_number_conversions.h"
 #include "content/common/gpu/gpu_channel_manager.h"
 #include "content/common/gpu/gpu_memory_allocation.h"
diff --git a/content/common/gpu/gpu_memory_tracking.h b/content/common/gpu/gpu_memory_tracking.h
index b27b605..bd0b400 100644
--- a/content/common/gpu/gpu_memory_tracking.h
+++ b/content/common/gpu/gpu_memory_tracking.h
@@ -6,7 +6,7 @@
 #define CONTENT_COMMON_GPU_GPU_MEMORY_TRACKING_H_
 
 #include "base/basictypes.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/common/content_export.h"
 #include "gpu/command_buffer/service/memory_tracking.h"
 
diff --git a/content/common/gpu/media/dxva_video_decode_accelerator.cc b/content/common/gpu/media/dxva_video_decode_accelerator.cc
index 138dca1..f999070 100644
--- a/content/common/gpu/media/dxva_video_decode_accelerator.cc
+++ b/content/common/gpu/media/dxva_video_decode_accelerator.cc
@@ -23,7 +23,6 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/shared_memory.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process_util.h"
 #include "media/video/video_decode_accelerator.h"
 #include "ui/gl/gl_bindings.h"
 #include "ui/gl/gl_surface_egl.h"
diff --git a/content/common/gpu/media/video_decode_accelerator_unittest.cc b/content/common/gpu/media/video_decode_accelerator_unittest.cc
index ec1ab8b..5e1768d 100644
--- a/content/common/gpu/media/video_decode_accelerator_unittest.cc
+++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc
@@ -32,7 +32,7 @@
 #include "base/format_macros.h"
 #include "base/md5.h"
 #include "base/platform_file.h"
-#include "base/process_util.h"
+#include "base/process/process.h"
 #include "base/stl_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_split.h"
diff --git a/content/common/handle_enumerator_win.cc b/content/common/handle_enumerator_win.cc
index 90401ed..98e232e 100644
--- a/content/common/handle_enumerator_win.cc
+++ b/content/common/handle_enumerator_win.cc
@@ -9,8 +9,7 @@
 
 #include "base/command_line.h"
 #include "base/logging.h"
-#include "base/process.h"
-#include "base/process_util.h"
+#include "base/process/process.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/win/windows_version.h"
 #include "content/public/common/content_switches.h"
diff --git a/content/common/handle_enumerator_win.h b/content/common/handle_enumerator_win.h
index 4a749e1..5fd4981 100644
--- a/content/common/handle_enumerator_win.h
+++ b/content/common/handle_enumerator_win.h
@@ -6,7 +6,7 @@
 #define CONTENT_COMMON_HANDLE_ENUMERATOR_WIN_H_
 
 #include "base/memory/ref_counted.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/strings/string16.h"
 
 namespace content {
diff --git a/content/common/media/midi_messages.h b/content/common/media/midi_messages.h
index de3cca6..d88216c 100644
--- a/content/common/media/midi_messages.h
+++ b/content/common/media/midi_messages.h
@@ -22,9 +22,8 @@
 IPC_STRUCT_TRAITS_END()
 
 // Renderer request to browser for access to MIDI services.
-IPC_MESSAGE_CONTROL2(MIDIHostMsg_RequestAccess,
-                     int /* client id */,
-                     int /* access */)
+IPC_MESSAGE_CONTROL1(MIDIHostMsg_StartSession,
+                     int /* client id */)
 
 IPC_MESSAGE_CONTROL3(MIDIHostMsg_SendData,
                      int /* port */,
@@ -33,9 +32,8 @@
 
 // Messages sent from the browser to the renderer.
 
-IPC_MESSAGE_CONTROL5(MIDIMsg_AccessApproved,
+IPC_MESSAGE_CONTROL4(MIDIMsg_SessionStarted,
                      int /* client id */,
-                     int /* access */,
                      bool /* success */,
                      media::MIDIPortInfoList /* input ports */,
                      media::MIDIPortInfoList /* output ports */)
diff --git a/content/common/page_zoom.cc b/content/common/page_zoom.cc
index 889d2e4..af448aa 100644
--- a/content/common/page_zoom.cc
+++ b/content/common/page_zoom.cc
@@ -11,9 +11,18 @@
 const double kMinimumZoomFactor = 0.25;
 const double kMaximumZoomFactor = 5.0;
 const double kEpsilon = 0.001;
+const double kTextSizeMultiplierRatio = 1.2;
 
 bool ZoomValuesEqual(double value_a, double value_b) {
   return (std::fabs(value_a - value_b) <= kEpsilon);
 }
 
+double ZoomLevelToZoomFactor(double zoom_level) {
+  return std::pow(kTextSizeMultiplierRatio, zoom_level);
+}
+
+double ZoomFactorToZoomLevel(double factor) {
+  return std::log(factor) / std::log(kTextSizeMultiplierRatio);
+}
+
 }  // namespace content
diff --git a/content/common/resource_messages.h b/content/common/resource_messages.h
index f982e11..0cf7bc8 100644
--- a/content/common/resource_messages.h
+++ b/content/common/resource_messages.h
@@ -8,7 +8,7 @@
 
 // Multiply-included message file, hence no include guard.
 #include "base/memory/shared_memory.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/common/content_param_traits_macros.h"
 #include "content/public/common/common_param_traits.h"
 #include "content/public/common/resource_response.h"
diff --git a/content/common/sandbox_mac_diraccess_unittest.mm b/content/common/sandbox_mac_diraccess_unittest.mm
index ad86e58..c8611df 100644
--- a/content/common/sandbox_mac_diraccess_unittest.mm
+++ b/content/common/sandbox_mac_diraccess_unittest.mm
@@ -11,6 +11,7 @@
 
 #include "base/file_util.h"
 #include "base/files/file_path.h"
+#include "base/process/kill.h"
 #include "base/strings/sys_string_conversions.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/test/multiprocess_test.h"
diff --git a/content/common/sandbox_mac_unittest_helper.mm b/content/common/sandbox_mac_unittest_helper.mm
index 4c64b55..0a8d3c1 100644
--- a/content/common/sandbox_mac_unittest_helper.mm
+++ b/content/common/sandbox_mac_unittest_helper.mm
@@ -13,6 +13,7 @@
 #include "base/files/file_path.h"
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
+#include "base/process/kill.h"
 #include "content/common/sandbox_mac.h"
 #include "content/test/test_content_client.h"
 #include "testing/multiprocess_func_list.h"
diff --git a/content/common/sandbox_util.h b/content/common/sandbox_util.h
index c6d2fce..54814df 100644
--- a/content/common/sandbox_util.h
+++ b/content/common/sandbox_util.h
@@ -5,7 +5,7 @@
 #ifndef CONTENT_COMMON_SANDBOX_UTIL_H_
 #define CONTENT_COMMON_SANDBOX_UTIL_H_
 
-#include "base/process.h"
+#include "base/process/process.h"
 #include "ipc/ipc_platform_file.h"
 
 // This file contains cross-platform sandbox code internal to content.
diff --git a/content/common/sandbox_win.cc b/content/common/sandbox_win.cc
index acd3f9a..83f3f72 100644
--- a/content/common/sandbox_win.cc
+++ b/content/common/sandbox_win.cc
@@ -14,7 +14,7 @@
 #include "base/file_util.h"
 #include "base/hash.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/win/iat_patch_function.h"
diff --git a/content/common/set_process_title.cc b/content/common/set_process_title.cc
index 7d7b057..6fde51b 100644
--- a/content/common/set_process_title.cc
+++ b/content/common/set_process_title.cc
@@ -21,7 +21,7 @@
 
 #include "base/file_util.h"
 #include "base/files/file_path.h"
-#include "base/process_util.h"
+#include "base/process/process_metrics.h"
 #include "base/strings/string_util.h"
 // Linux/glibc doesn't natively have setproctitle().
 #include "content/common/set_process_title_linux.h"
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index a34bc69..e977349 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -6,7 +6,7 @@
 // Multiply-included message file, hence no include guard.
 
 #include "base/memory/shared_memory.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/strings/string16.h"
 #include "cc/output/begin_frame_args.h"
 #include "cc/output/compositor_frame.h"
@@ -49,7 +49,6 @@
 #include "third_party/WebKit/public/web/WebPopupType.h"
 #include "third_party/WebKit/public/web/WebScreenInfo.h"
 #include "third_party/WebKit/public/web/WebTextDirection.h"
-#include "third_party/WebKit/public/web/WebWindowFeatures.h"
 #include "third_party/skia/include/core/SkBitmap.h"
 #include "ui/base/ime/text_input_mode.h"
 #include "ui/base/ime/text_input_type.h"
@@ -314,25 +313,6 @@
   IPC_STRUCT_TRAITS_MEMBER(total_scroll_update_latency)
 IPC_STRUCT_TRAITS_END()
 
-IPC_STRUCT_TRAITS_BEGIN(WebKit::WebWindowFeatures)
-  IPC_STRUCT_TRAITS_MEMBER(x)
-  IPC_STRUCT_TRAITS_MEMBER(xSet)
-  IPC_STRUCT_TRAITS_MEMBER(y)
-  IPC_STRUCT_TRAITS_MEMBER(ySet)
-  IPC_STRUCT_TRAITS_MEMBER(width)
-  IPC_STRUCT_TRAITS_MEMBER(widthSet)
-  IPC_STRUCT_TRAITS_MEMBER(height)
-  IPC_STRUCT_TRAITS_MEMBER(heightSet)
-  IPC_STRUCT_TRAITS_MEMBER(menuBarVisible)
-  IPC_STRUCT_TRAITS_MEMBER(statusBarVisible)
-  IPC_STRUCT_TRAITS_MEMBER(toolBarVisible)
-  IPC_STRUCT_TRAITS_MEMBER(locationBarVisible)
-  IPC_STRUCT_TRAITS_MEMBER(scrollbarsVisible)
-  IPC_STRUCT_TRAITS_MEMBER(resizable)
-  IPC_STRUCT_TRAITS_MEMBER(fullscreen)
-  IPC_STRUCT_TRAITS_MEMBER(dialog)
-IPC_STRUCT_TRAITS_END()
-
 IPC_STRUCT_BEGIN(ViewHostMsg_CreateWindow_Params)
   // Routing ID of the view initiating the open.
   IPC_STRUCT_MEMBER(int, opener_id)
diff --git a/content/content_browsertests.isolate b/content/content_browsertests.isolate
index 4c31a24..55b0f56 100644
--- a/content/content_browsertests.isolate
+++ b/content/content_browsertests.isolate
@@ -26,10 +26,11 @@
         'command': [
           '../testing/xvfb.py',
           '<(PRODUCT_DIR)',
-          '../tools/swarm_client/run_test_cases.py',
+          '../tools/swarm_client/googletest/run_test_cases.py',
           '<(PRODUCT_DIR)/content_browsertests<(EXECUTABLE_SUFFIX)',
         ],
         'isolate_dependency_tracked': [
+          '../testing/xvfb.py',
           '<(PRODUCT_DIR)/content_shell.pak',
           '<(PRODUCT_DIR)/fonts.conf',
           '<(PRODUCT_DIR)/libclearkeycdm.so',
@@ -43,6 +44,9 @@
     ['OS=="linux" or OS=="mac" or OS=="win"', {
       'variables': {
         'isolate_dependency_tracked': [
+          '../testing/test_env.py',
+          '../tools/swarm_client/run_isolated.py',
+          '../tools/swarm_client/googletest/run_test_cases.py',
           '<(PRODUCT_DIR)/content_browsertests<(EXECUTABLE_SUFFIX)',
         ],
         'isolate_dependency_untracked': [
@@ -73,7 +77,7 @@
       'variables': {
         'command': [
           '../testing/test_env.py',
-          '../tools/swarm_client/run_test_cases.py',
+          '../tools/swarm_client/googletest/run_test_cases.py',
           '<(PRODUCT_DIR)/content_browsertests<(EXECUTABLE_SUFFIX)',
         ],
       },
diff --git a/content/content_child.gypi b/content/content_child.gypi
index ffca557..72d48b1 100644
--- a/content/content_child.gypi
+++ b/content/content_child.gypi
@@ -6,6 +6,7 @@
   'dependencies': [
     '../base/base.gyp:base',
     '../components/tracing.gyp:tracing',
+    '../skia/skia.gyp:skia',
     '../ui/ui.gyp:ui',
     '../url/url.gyp:url_lib',
   ],
@@ -130,6 +131,12 @@
         '../build/android/cpufeatures.gypi',
       ],
     }],
+    ['enable_plugins==1', {
+      'sources': [
+        'child/browser_font_resource_trusted.cc',
+        'child/browser_font_resource_trusted.h',
+      ],
+    }],
     ['OS=="ios"', {
       'sources/': [
         # iOS only needs a small portion of content; exclude all the
diff --git a/content/content_child.target.darwin-arm.mk b/content/content_child.target.darwin-arm.mk
index 69bbd0c..19d850d 100644
--- a/content/content_child.target.darwin-arm.mk
+++ b/content/content_child.target.darwin-arm.mk
@@ -11,10 +11,11 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_child_gyp)/webkit_support_glue_child_gyp.a
 
@@ -125,14 +126,14 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
 	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
+	'-DPOSIX_AVOID_MMAP' \
+	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -153,10 +154,6 @@
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
@@ -171,6 +168,10 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/v8/include \
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
@@ -239,14 +240,14 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
 	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
+	'-DPOSIX_AVOID_MMAP' \
+	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -268,10 +269,6 @@
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
@@ -286,6 +283,10 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/v8/include \
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
@@ -349,8 +350,8 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
-	ui_ui_gyp \
 	skia_skia_library_gyp \
+	ui_ui_gyp \
 	webkit_support_glue_child_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_child.target.darwin-mips.mk b/content/content_child.target.darwin-mips.mk
index b9f3ece..dd6b241 100644
--- a/content/content_child.target.darwin-mips.mk
+++ b/content/content_child.target.darwin-mips.mk
@@ -11,10 +11,11 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_child_gyp)/webkit_support_glue_child_gyp.a
 
@@ -124,14 +125,14 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
 	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
+	'-DPOSIX_AVOID_MMAP' \
+	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -152,10 +153,6 @@
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
@@ -170,6 +167,10 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/v8/include \
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
@@ -237,14 +238,14 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
 	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
+	'-DPOSIX_AVOID_MMAP' \
+	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -266,10 +267,6 @@
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
@@ -284,6 +281,10 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/v8/include \
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
@@ -343,8 +344,8 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
-	ui_ui_gyp \
 	skia_skia_library_gyp \
+	ui_ui_gyp \
 	webkit_support_glue_child_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_child.target.darwin-x86.mk b/content/content_child.target.darwin-x86.mk
index 33d662e..234a321 100644
--- a/content/content_child.target.darwin-x86.mk
+++ b/content/content_child.target.darwin-x86.mk
@@ -11,10 +11,11 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_child_gyp)/webkit_support_glue_child_gyp.a
 
@@ -127,13 +128,13 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
 	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
+	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -154,10 +155,6 @@
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
@@ -172,6 +169,10 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/v8/include \
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
@@ -243,13 +244,13 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
 	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
+	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -271,10 +272,6 @@
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
@@ -289,6 +286,10 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/v8/include \
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
@@ -347,8 +348,8 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
-	ui_ui_gyp \
 	skia_skia_library_gyp \
+	ui_ui_gyp \
 	webkit_support_glue_child_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_child.target.linux-arm.mk b/content/content_child.target.linux-arm.mk
index 69bbd0c..19d850d 100644
--- a/content/content_child.target.linux-arm.mk
+++ b/content/content_child.target.linux-arm.mk
@@ -11,10 +11,11 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_child_gyp)/webkit_support_glue_child_gyp.a
 
@@ -125,14 +126,14 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
 	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
+	'-DPOSIX_AVOID_MMAP' \
+	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -153,10 +154,6 @@
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
@@ -171,6 +168,10 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/v8/include \
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
@@ -239,14 +240,14 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
 	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
+	'-DPOSIX_AVOID_MMAP' \
+	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -268,10 +269,6 @@
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
@@ -286,6 +283,10 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/v8/include \
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
@@ -349,8 +350,8 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
-	ui_ui_gyp \
 	skia_skia_library_gyp \
+	ui_ui_gyp \
 	webkit_support_glue_child_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_child.target.linux-mips.mk b/content/content_child.target.linux-mips.mk
index b9f3ece..dd6b241 100644
--- a/content/content_child.target.linux-mips.mk
+++ b/content/content_child.target.linux-mips.mk
@@ -11,10 +11,11 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_child_gyp)/webkit_support_glue_child_gyp.a
 
@@ -124,14 +125,14 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
 	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
+	'-DPOSIX_AVOID_MMAP' \
+	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -152,10 +153,6 @@
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
@@ -170,6 +167,10 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/v8/include \
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
@@ -237,14 +238,14 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
 	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
+	'-DPOSIX_AVOID_MMAP' \
+	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -266,10 +267,6 @@
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
@@ -284,6 +281,10 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/v8/include \
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
@@ -343,8 +344,8 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
-	ui_ui_gyp \
 	skia_skia_library_gyp \
+	ui_ui_gyp \
 	webkit_support_glue_child_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_child.target.linux-x86.mk b/content/content_child.target.linux-x86.mk
index 33d662e..234a321 100644
--- a/content/content_child.target.linux-x86.mk
+++ b/content/content_child.target.linux-x86.mk
@@ -11,10 +11,11 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_child_gyp)/webkit_support_glue_child_gyp.a
 
@@ -127,13 +128,13 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
 	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
+	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -154,10 +155,6 @@
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
@@ -172,6 +169,10 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/v8/include \
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
@@ -243,13 +244,13 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
 	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
+	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -271,10 +272,6 @@
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
@@ -289,6 +286,10 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/v8/include \
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
@@ -347,8 +348,8 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
-	ui_ui_gyp \
 	skia_skia_library_gyp \
+	ui_ui_gyp \
 	webkit_support_glue_child_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_common.target.darwin-arm.mk b/content/content_common.target.darwin-arm.mk
index e93b795..af8978d 100644
--- a/content/content_common.target.darwin-arm.mk
+++ b/content/content_common.target.darwin-arm.mk
@@ -230,6 +230,7 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/v8/include \
 	$(gyp_shared_intermediate_dir)/ui/gl \
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(PWD)/frameworks/wilhelm/include \
@@ -345,6 +346,7 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/v8/include \
 	$(gyp_shared_intermediate_dir)/ui/gl \
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(PWD)/frameworks/wilhelm/include \
diff --git a/content/content_common.target.darwin-mips.mk b/content/content_common.target.darwin-mips.mk
index 0e3f8ec..c4e7f04 100644
--- a/content/content_common.target.darwin-mips.mk
+++ b/content/content_common.target.darwin-mips.mk
@@ -229,6 +229,7 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/v8/include \
 	$(gyp_shared_intermediate_dir)/ui/gl \
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(PWD)/frameworks/wilhelm/include \
@@ -343,6 +344,7 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/v8/include \
 	$(gyp_shared_intermediate_dir)/ui/gl \
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(PWD)/frameworks/wilhelm/include \
diff --git a/content/content_common.target.darwin-x86.mk b/content/content_common.target.darwin-x86.mk
index ec24faf..cba49ee 100644
--- a/content/content_common.target.darwin-x86.mk
+++ b/content/content_common.target.darwin-x86.mk
@@ -231,6 +231,7 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/v8/include \
 	$(gyp_shared_intermediate_dir)/ui/gl \
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(PWD)/frameworks/wilhelm/include \
@@ -348,6 +349,7 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/v8/include \
 	$(gyp_shared_intermediate_dir)/ui/gl \
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(PWD)/frameworks/wilhelm/include \
diff --git a/content/content_common.target.linux-arm.mk b/content/content_common.target.linux-arm.mk
index e93b795..af8978d 100644
--- a/content/content_common.target.linux-arm.mk
+++ b/content/content_common.target.linux-arm.mk
@@ -230,6 +230,7 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/v8/include \
 	$(gyp_shared_intermediate_dir)/ui/gl \
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(PWD)/frameworks/wilhelm/include \
@@ -345,6 +346,7 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/v8/include \
 	$(gyp_shared_intermediate_dir)/ui/gl \
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(PWD)/frameworks/wilhelm/include \
diff --git a/content/content_common.target.linux-mips.mk b/content/content_common.target.linux-mips.mk
index 0e3f8ec..c4e7f04 100644
--- a/content/content_common.target.linux-mips.mk
+++ b/content/content_common.target.linux-mips.mk
@@ -229,6 +229,7 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/v8/include \
 	$(gyp_shared_intermediate_dir)/ui/gl \
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(PWD)/frameworks/wilhelm/include \
@@ -343,6 +344,7 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/v8/include \
 	$(gyp_shared_intermediate_dir)/ui/gl \
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(PWD)/frameworks/wilhelm/include \
diff --git a/content/content_common.target.linux-x86.mk b/content/content_common.target.linux-x86.mk
index ec24faf..cba49ee 100644
--- a/content/content_common.target.linux-x86.mk
+++ b/content/content_common.target.linux-x86.mk
@@ -231,6 +231,7 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/v8/include \
 	$(gyp_shared_intermediate_dir)/ui/gl \
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(PWD)/frameworks/wilhelm/include \
@@ -348,6 +349,7 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
+	$(LOCAL_PATH)/v8/include \
 	$(gyp_shared_intermediate_dir)/ui/gl \
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(PWD)/frameworks/wilhelm/include \
diff --git a/content/content_renderer.gypi b/content/content_renderer.gypi
index f60d010..4f4ddf5 100644
--- a/content/content_renderer.gypi
+++ b/content/content_renderer.gypi
@@ -5,6 +5,7 @@
 {
   'dependencies': [
     '../jingle/jingle.gyp:jingle_glue',
+    '../media/media.gyp:media',
     '../net/net.gyp:net',
     '../skia/skia.gyp:skia',
     '../third_party/WebKit/public/blink.gyp:blink',
@@ -46,7 +47,7 @@
     'public/renderer/navigation_state.cc',
     'public/renderer/navigation_state.h',
     'public/renderer/password_form_conversion_utils.h',
-    'public/renderer/ppapi_plugin_instance.h',
+    'public/renderer/pepper_plugin_instance.h',
     'public/renderer/renderer_ppapi_host.h',
     'public/renderer/render_frame.h',
     'public/renderer/render_process_observer.cc',
@@ -200,6 +201,8 @@
     'renderer/media/media_stream_dispatcher.h',
     'renderer/media/media_stream_dispatcher_eventhandler.h',
     'renderer/media/media_stream_impl.h',
+    'renderer/media/midi_dispatcher.cc',
+    'renderer/media/midi_dispatcher.h',
     'renderer/media/midi_message_filter.cc',
     'renderer/media/midi_message_filter.h',
     'renderer/media/pepper_platform_video_decoder_impl.cc',
@@ -318,6 +321,8 @@
     'renderer/pepper/pepper_platform_video_capture_impl.h',
     'renderer/pepper/pepper_plugin_delegate_impl.cc',
     'renderer/pepper/pepper_plugin_delegate_impl.h',
+    'renderer/pepper/pepper_plugin_instance_impl.cc',
+    'renderer/pepper/pepper_plugin_instance_impl.h',
     'renderer/pepper/pepper_plugin_registry.cc',
     'renderer/pepper/pepper_plugin_registry.h',
     'renderer/pepper/pepper_proxy_channel_delegate_impl.cc',
@@ -333,6 +338,8 @@
     'renderer/pepper/pepper_url_loader_host.h',
     'renderer/pepper/pepper_video_capture_host.cc',
     'renderer/pepper/pepper_video_capture_host.h',
+    'renderer/pepper/pepper_webplugin_impl.cc',
+    'renderer/pepper/pepper_webplugin_impl.h',
     'renderer/pepper/pepper_websocket_host.cc',
     'renderer/pepper/pepper_websocket_host.h',
     'renderer/pepper/plugin_delegate.h',
@@ -340,12 +347,6 @@
     'renderer/pepper/plugin_module.h',
     'renderer/pepper/plugin_object.cc',
     'renderer/pepper/plugin_object.h',
-    'renderer/pepper/ppapi_interface_factory.cc',
-    'renderer/pepper/ppapi_interface_factory.h',
-    'renderer/pepper/ppapi_plugin_instance_impl.cc',
-    'renderer/pepper/ppapi_plugin_instance_impl.h',
-    'renderer/pepper/ppapi_webplugin_impl.cc',
-    'renderer/pepper/ppapi_webplugin_impl.h',
     'renderer/pepper/ppb_audio_impl.cc',
     'renderer/pepper/ppb_audio_impl.h',
     'renderer/pepper/ppb_broker_impl.cc',
diff --git a/content/content_renderer.target.darwin-arm.mk b/content/content_renderer.target.darwin-arm.mk
index ba9df3b..867f65e 100644
--- a/content/content_renderer.target.darwin-arm.mk
+++ b/content/content_renderer.target.darwin-arm.mk
@@ -107,6 +107,7 @@
 	content/renderer/media/crypto/key_systems.cc \
 	content/renderer/media/crypto/key_systems_info.cc \
 	content/renderer/media/crypto/proxy_decryptor.cc \
+	content/renderer/media/midi_dispatcher.cc \
 	content/renderer/media/midi_message_filter.cc \
 	content/renderer/media/pepper_platform_video_decoder_impl.cc \
 	content/renderer/media/render_media_log.cc \
@@ -236,6 +237,7 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
+	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
@@ -377,6 +379,7 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
+	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
diff --git a/content/content_renderer.target.darwin-mips.mk b/content/content_renderer.target.darwin-mips.mk
index f388456..b9a9cbc 100644
--- a/content/content_renderer.target.darwin-mips.mk
+++ b/content/content_renderer.target.darwin-mips.mk
@@ -107,6 +107,7 @@
 	content/renderer/media/crypto/key_systems.cc \
 	content/renderer/media/crypto/key_systems_info.cc \
 	content/renderer/media/crypto/proxy_decryptor.cc \
+	content/renderer/media/midi_dispatcher.cc \
 	content/renderer/media/midi_message_filter.cc \
 	content/renderer/media/pepper_platform_video_decoder_impl.cc \
 	content/renderer/media/render_media_log.cc \
@@ -235,6 +236,7 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
+	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
@@ -375,6 +377,7 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
+	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
diff --git a/content/content_renderer.target.darwin-x86.mk b/content/content_renderer.target.darwin-x86.mk
index 5950770..fdaff3a 100644
--- a/content/content_renderer.target.darwin-x86.mk
+++ b/content/content_renderer.target.darwin-x86.mk
@@ -107,6 +107,7 @@
 	content/renderer/media/crypto/key_systems.cc \
 	content/renderer/media/crypto/key_systems_info.cc \
 	content/renderer/media/crypto/proxy_decryptor.cc \
+	content/renderer/media/midi_dispatcher.cc \
 	content/renderer/media/midi_message_filter.cc \
 	content/renderer/media/pepper_platform_video_decoder_impl.cc \
 	content/renderer/media/render_media_log.cc \
@@ -238,6 +239,7 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
+	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
@@ -381,6 +383,7 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
+	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
diff --git a/content/content_renderer.target.linux-arm.mk b/content/content_renderer.target.linux-arm.mk
index ba9df3b..867f65e 100644
--- a/content/content_renderer.target.linux-arm.mk
+++ b/content/content_renderer.target.linux-arm.mk
@@ -107,6 +107,7 @@
 	content/renderer/media/crypto/key_systems.cc \
 	content/renderer/media/crypto/key_systems_info.cc \
 	content/renderer/media/crypto/proxy_decryptor.cc \
+	content/renderer/media/midi_dispatcher.cc \
 	content/renderer/media/midi_message_filter.cc \
 	content/renderer/media/pepper_platform_video_decoder_impl.cc \
 	content/renderer/media/render_media_log.cc \
@@ -236,6 +237,7 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
+	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
@@ -377,6 +379,7 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
+	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
diff --git a/content/content_renderer.target.linux-mips.mk b/content/content_renderer.target.linux-mips.mk
index f388456..b9a9cbc 100644
--- a/content/content_renderer.target.linux-mips.mk
+++ b/content/content_renderer.target.linux-mips.mk
@@ -107,6 +107,7 @@
 	content/renderer/media/crypto/key_systems.cc \
 	content/renderer/media/crypto/key_systems_info.cc \
 	content/renderer/media/crypto/proxy_decryptor.cc \
+	content/renderer/media/midi_dispatcher.cc \
 	content/renderer/media/midi_message_filter.cc \
 	content/renderer/media/pepper_platform_video_decoder_impl.cc \
 	content/renderer/media/render_media_log.cc \
@@ -235,6 +236,7 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
+	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
@@ -375,6 +377,7 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
+	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
diff --git a/content/content_renderer.target.linux-x86.mk b/content/content_renderer.target.linux-x86.mk
index 5950770..fdaff3a 100644
--- a/content/content_renderer.target.linux-x86.mk
+++ b/content/content_renderer.target.linux-x86.mk
@@ -107,6 +107,7 @@
 	content/renderer/media/crypto/key_systems.cc \
 	content/renderer/media/crypto/key_systems_info.cc \
 	content/renderer/media/crypto/proxy_decryptor.cc \
+	content/renderer/media/midi_dispatcher.cc \
 	content/renderer/media/midi_message_filter.cc \
 	content/renderer/media/pepper_platform_video_decoder_impl.cc \
 	content/renderer/media/render_media_log.cc \
@@ -238,6 +239,7 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
+	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
@@ -381,6 +383,7 @@
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
+	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
diff --git a/content/content_shell.gypi b/content/content_shell.gypi
index 129c2a2..4d120af 100644
--- a/content/content_shell.gypi
+++ b/content/content_shell.gypi
@@ -356,6 +356,7 @@
         'content_shell_lib',
         'content_shell_pak',
         '../third_party/mesa/mesa.gyp:osmesa',
+        '../tools/imagediff/image_diff.gyp:image_diff',
       ],
       'include_dirs': [
         '..',
@@ -484,6 +485,16 @@
             },
           ],
         }],  # OS=="mac"
+        ['OS=="android"', {
+          'dependencies!': [
+            '../tools/imagediff/image_diff.gyp:image_diff',
+          ],
+        }],  # OS=="android"
+        ['OS=="android" and android_webview_build==0', {
+          'dependencies': [
+            '../tools/imagediff/image_diff.gyp:image_diff#host',
+          ],
+        }],  # OS=="android" and android_webview_build==0
       ],
     },
     {
diff --git a/content/content_tests.gypi b/content/content_tests.gypi
index dd31481..6e69912 100644
--- a/content/content_tests.gypi
+++ b/content/content_tests.gypi
@@ -437,7 +437,7 @@
         'renderer/pepper/mock_plugin_delegate.cc',
         'renderer/pepper/mock_plugin_delegate.h',
         'renderer/pepper/mock_resource.h',
-        'renderer/pepper/ppapi_plugin_instance_unittest.cc',
+        'renderer/pepper/pepper_plugin_instance_unittest.cc',
         'renderer/pepper/ppapi_unittest.cc',
         'renderer/pepper/ppapi_unittest.h',
         'renderer/pepper/quota_file_io_unittest.cc',
diff --git a/content/content_unittests.isolate b/content/content_unittests.isolate
index a3bd8e8..9a9def4 100644
--- a/content/content_unittests.isolate
+++ b/content/content_unittests.isolate
@@ -27,7 +27,7 @@
         'command': [
           '../testing/xvfb.py',
           '<(PRODUCT_DIR)',
-          '../tools/swarm_client/run_test_cases.py',
+          '../tools/swarm_client/googletest/run_test_cases.py',
           '<(PRODUCT_DIR)/content_unittests<(EXECUTABLE_SUFFIX)',
         ],
         'isolate_dependency_tracked': [
@@ -56,7 +56,7 @@
       'variables': {
         'command': [
           '../testing/test_env.py',
-          '../tools/swarm_client/run_test_cases.py',
+          '../tools/swarm_client/googletest/run_test_cases.py',
           '<(PRODUCT_DIR)/content_unittests<(EXECUTABLE_SUFFIX)',
         ],
       },
diff --git a/content/gpu/gpu_watchdog_thread.cc b/content/gpu/gpu_watchdog_thread.cc
index 09e710e..e823edd 100644
--- a/content/gpu/gpu_watchdog_thread.cc
+++ b/content/gpu/gpu_watchdog_thread.cc
@@ -12,8 +12,7 @@
 #include "base/bind_helpers.h"
 #include "base/command_line.h"
 #include "base/compiler_specific.h"
-#include "base/process_util.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "build/build_config.h"
 #include "content/public/common/content_switches.h"
 #include "content/public/common/result_codes.h"
diff --git a/content/plugin/plugin_channel.cc b/content/plugin/plugin_channel.cc
index 0556f82..31cba22 100644
--- a/content/plugin/plugin_channel.cc
+++ b/content/plugin/plugin_channel.cc
@@ -6,7 +6,7 @@
 
 #include "base/bind.h"
 #include "base/command_line.h"
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
 #include "base/strings/string_util.h"
 #include "base/synchronization/lock.h"
 #include "base/synchronization/waitable_event.h"
diff --git a/content/plugin/plugin_channel.h b/content/plugin/plugin_channel.h
index a5844e3..8af63b9 100644
--- a/content/plugin/plugin_channel.h
+++ b/content/plugin/plugin_channel.h
@@ -8,7 +8,7 @@
 #include <vector>
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_handle.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "build/build_config.h"
 #include "content/child/npapi/np_channel_base.h"
 #include "content/plugin/webplugin_delegate_stub.h"
diff --git a/content/plugin/plugin_thread.cc b/content/plugin/plugin_thread.cc
index 5faeb74..e6b477f 100644
--- a/content/plugin/plugin_thread.cc
+++ b/content/plugin/plugin_thread.cc
@@ -18,7 +18,8 @@
 #include "base/bind.h"
 #include "base/command_line.h"
 #include "base/lazy_instance.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
+#include "base/process/process_handle.h"
 #include "base/threading/thread_local.h"
 #include "content/child/child_process.h"
 #include "content/child/npapi/npobject_util.h"
diff --git a/content/port/browser/render_widget_host_view_port.h b/content/port/browser/render_widget_host_view_port.h
index 7cccbb1..a6d3164 100644
--- a/content/port/browser/render_widget_host_view_port.h
+++ b/content/port/browser/render_widget_host_view_port.h
@@ -6,7 +6,7 @@
 #define CONTENT_PORT_BROWSER_RENDER_WIDGET_HOST_VIEW_PORT_H_
 
 #include "base/callback.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
 #include "base/strings/string16.h"
 #include "cc/output/compositor_frame.h"
 #include "content/common/content_export.h"
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc
index c228bf6..370e465 100644
--- a/content/ppapi_plugin/ppapi_thread.cc
+++ b/content/ppapi_plugin/ppapi_thread.cc
@@ -10,12 +10,12 @@
 #include "base/debug/crash_logging.h"
 #include "base/logging.h"
 #include "base/metrics/histogram.h"
-#include "base/process_util.h"
 #include "base/rand_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/threading/platform_thread.h"
 #include "base/time/time.h"
+#include "content/child/browser_font_resource_trusted.h"
 #include "content/child/child_process.h"
 #include "content/common/child_process_messages.h"
 #include "content/common/sandbox_util.h"
@@ -210,6 +210,17 @@
   GetContentClient()->SetActiveURL(GURL(url));
 }
 
+PP_Resource PpapiThread::CreateBrowserFont(
+    ppapi::proxy::Connection connection,
+    PP_Instance instance,
+    const PP_BrowserFont_Trusted_Description& desc,
+    const ppapi::Preferences& prefs) {
+  if (!BrowserFontResource_Trusted::IsPPFontDescriptionValid(desc))
+    return 0;
+  return (new BrowserFontResource_Trusted(
+        connection, instance, desc, prefs))->GetReference();
+}
+
 uint32 PpapiThread::Register(ppapi::proxy::PluginDispatcher* plugin_dispatcher) {
   if (!plugin_dispatcher ||
       plugin_dispatchers_.size() >= std::numeric_limits<uint32>::max()) {
diff --git a/content/ppapi_plugin/ppapi_thread.h b/content/ppapi_plugin/ppapi_thread.h
index 7726a98..d1ca550 100644
--- a/content/ppapi_plugin/ppapi_thread.h
+++ b/content/ppapi_plugin/ppapi_thread.h
@@ -11,7 +11,7 @@
 #include "base/basictypes.h"
 #include "base/compiler_specific.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/scoped_native_library.h"
 #include "build/build_config.h"
 #include "content/child/child_thread.h"
@@ -19,6 +19,7 @@
 #include "ipc/ipc_listener.h"
 #include "ppapi/c/pp_module.h"
 #include "ppapi/c/trusted/ppp_broker.h"
+#include "ppapi/proxy/connection.h"
 #include "ppapi/proxy/plugin_dispatcher.h"
 #include "ppapi/proxy/plugin_globals.h"
 #include "ppapi/proxy/plugin_proxy_delegate.h"
@@ -101,6 +102,11 @@
   virtual std::string GetUILanguage() OVERRIDE;
   virtual void PreCacheFont(const void* logfontw) OVERRIDE;
   virtual void SetActiveURL(const std::string& url) OVERRIDE;
+  virtual PP_Resource CreateBrowserFont(
+      ppapi::proxy::Connection connection,
+      PP_Instance instance,
+      const PP_BrowserFont_Trusted_Description& desc,
+      const ppapi::Preferences& prefs) OVERRIDE;
 
   // Message handlers.
   void OnLoadPlugin(const base::FilePath& path,
diff --git a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
index f1cc5b0..4c02999 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
@@ -167,7 +167,7 @@
         return;
     }
 
-    // Represents an invalid process handle; same as base/process.h kNullProcessHandle.
+    // Represents an invalid process handle; same as base/process/process.h kNullProcessHandle.
     private static final int NULL_PROCESS_HANDLE = 0;
 
     // Map from pid to ChildService connection.
diff --git a/content/public/browser/browser_child_process_host.h b/content/public/browser/browser_child_process_host.h
index d2b4fc5..7553478 100644
--- a/content/public/browser/browser_child_process_host.h
+++ b/content/public/browser/browser_child_process_host.h
@@ -5,7 +5,10 @@
 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_
 #define CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_
 
-#include "base/process_util.h"
+#include "base/process/kill.h"
+#include "base/process/launch.h"
+#include "base/process/process_handle.h"
+#include "base/process/process_metrics.h"
 #include "base/strings/string16.h"
 #include "build/build_config.h"
 #include "content/common/content_export.h"
diff --git a/content/public/browser/browser_message_filter.cc b/content/public/browser/browser_message_filter.cc
index e3c43a4..53c0f87 100644
--- a/content/public/browser/browser_message_filter.cc
+++ b/content/public/browser/browser_message_filter.cc
@@ -7,8 +7,8 @@
 #include "base/bind.h"
 #include "base/bind_helpers.h"
 #include "base/logging.h"
-#include "base/process.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
+#include "base/process/process_handle.h"
 #include "base/task_runner.h"
 #include "content/public/browser/user_metrics.h"
 #include "content/public/common/result_codes.h"
diff --git a/content/public/browser/browser_message_filter.h b/content/public/browser/browser_message_filter.h
index 52c802a..c997cc6 100644
--- a/content/public/browser/browser_message_filter.h
+++ b/content/public/browser/browser_message_filter.h
@@ -5,7 +5,7 @@
 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_MESSAGE_FILTER_H_
 #define CONTENT_PUBLIC_BROWSER_BROWSER_MESSAGE_FILTER_H_
 
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/common/content_export.h"
 #include "content/public/browser/browser_thread.h"
 #include "ipc/ipc_channel_proxy.h"
diff --git a/content/public/browser/browser_plugin_guest_delegate.h b/content/public/browser/browser_plugin_guest_delegate.h
index 21c4419..df98e4f 100644
--- a/content/public/browser/browser_plugin_guest_delegate.h
+++ b/content/public/browser/browser_plugin_guest_delegate.h
@@ -5,7 +5,7 @@
 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_
 #define CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_
 
-#include "base/process_util.h"
+#include "base/process/kill.h"
 #include "base/strings/string16.h"
 #include "content/common/content_export.h"
 
@@ -35,6 +35,12 @@
   virtual void GuestProcessGone(base::TerminationStatus status) {}
 
   virtual bool HandleKeyboardEvent(const NativeWebKeyboardEvent& event);
+
+  // Notification that the guest is no longer hung.
+  virtual void RendererResponsive() {}
+
+  // Notification that the guest is hung.
+  virtual void RendererUnresponsive() {}
 };
 
 }  // namespace content
diff --git a/content/public/browser/browser_ppapi_host.h b/content/public/browser/browser_ppapi_host.h
index 47edee7..1ad0d17 100644
--- a/content/public/browser/browser_ppapi_host.h
+++ b/content/public/browser/browser_ppapi_host.h
@@ -6,7 +6,7 @@
 #define CONTENT_PUBLIC_BROWSER_BROWSER_PPAPI_HOST_H_
 
 #include "base/callback_forward.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/common/content_export.h"
 #include "content/public/browser/render_view_host.h"
 #include "ppapi/c/pp_instance.h"
diff --git a/content/public/browser/child_process_data.h b/content/public/browser/child_process_data.h
index 31798dc..b669305 100644
--- a/content/public/browser/child_process_data.h
+++ b/content/public/browser/child_process_data.h
@@ -5,7 +5,7 @@
 #ifndef CONTENT_PUBLIC_BROWSER_CHILD_PROCESS_DATA_H_
 #define CONTENT_PUBLIC_BROWSER_CHILD_PROCESS_DATA_H_
 
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/strings/string16.h"
 #include "content/common/content_export.h"
 
diff --git a/content/public/browser/gpu_data_manager.h b/content/public/browser/gpu_data_manager.h
index 20657ea..8f15be3 100644
--- a/content/public/browser/gpu_data_manager.h
+++ b/content/public/browser/gpu_data_manager.h
@@ -9,7 +9,7 @@
 #include <string>
 
 #include "base/callback_forward.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/common/content_export.h"
 
 class GURL;
diff --git a/content/public/browser/gpu_data_manager_observer.h b/content/public/browser/gpu_data_manager_observer.h
index da08181..d52e668 100644
--- a/content/public/browser/gpu_data_manager_observer.h
+++ b/content/public/browser/gpu_data_manager_observer.h
@@ -5,7 +5,7 @@
 #ifndef CONTENT_PUBLIC_BROWSER_GPU_DATA_MANAGER_OBSERVER_H_
 #define CONTENT_PUBLIC_BROWSER_GPU_DATA_MANAGER_OBSERVER_H_
 
-#include "base/process_util.h"
+#include "base/process/kill.h"
 #include "content/common/content_export.h"
 #include "content/public/common/gpu_memory_stats.h"
 #include "content/public/common/three_d_api_types.h"
diff --git a/content/public/browser/overscroll_configuration.h b/content/public/browser/overscroll_configuration.h
index a8ca931..5335733 100644
--- a/content/public/browser/overscroll_configuration.h
+++ b/content/public/browser/overscroll_configuration.h
@@ -15,7 +15,8 @@
   OVERSCROLL_CONFIG_NONE,
   OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE,
   OVERSCROLL_CONFIG_VERT_THRESHOLD_COMPLETE,
-  OVERSCROLL_CONFIG_MIN_THRESHOLD_START,
+  OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START,
+  OVERSCROLL_CONFIG_VERT_THRESHOLD_START,
   OVERSCROLL_CONFIG_HORIZ_RESIST_AFTER,
   OVERSCROLL_CONFIG_VERT_RESIST_AFTER,
   OVERSCROLL_CONFIG_COUNT
diff --git a/content/public/browser/render_process_host.h b/content/public/browser/render_process_host.h
index 4b78a88..ccc1e72 100644
--- a/content/public/browser/render_process_host.h
+++ b/content/public/browser/render_process_host.h
@@ -7,8 +7,8 @@
 
 #include "base/basictypes.h"
 #include "base/id_map.h"
-#include "base/process.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
+#include "base/process/process_handle.h"
 #include "content/common/content_export.h"
 #include "ipc/ipc_channel_proxy.h"
 #include "ipc/ipc_sender.h"
diff --git a/content/public/browser/storage_partition.h b/content/public/browser/storage_partition.h
index a8e451c..bd7f90c 100644
--- a/content/public/browser/storage_partition.h
+++ b/content/public/browser/storage_partition.h
@@ -56,63 +56,56 @@
   virtual DOMStorageContext* GetDOMStorageContext() = 0;
   virtual IndexedDBContext* GetIndexedDBContext() = 0;
 
-  enum RemoveDataMask {
-    REMOVE_DATA_MASK_APPCACHE = 1 << 0,
-    REMOVE_DATA_MASK_COOKIES = 1 << 1,
-    REMOVE_DATA_MASK_FILE_SYSTEMS = 1 << 2,
-    REMOVE_DATA_MASK_INDEXEDDB = 1 << 3,
-    REMOVE_DATA_MASK_LOCAL_STORAGE = 1 << 4,
-    REMOVE_DATA_MASK_SHADER_CACHE = 1 << 5,
-    REMOVE_DATA_MASK_WEBSQL = 1 << 6,
+  enum StorageMask {
+    kCookies = 1 << 0,
 
-    REMOVE_DATA_MASK_ALL = -1
-  };
-
-  // TODO(lazyboy): Value in the enum should start with the enum prefix
-  // (QUOTA_MANAGED_STORAGE_MASK_*).
-  enum QuotaManagedStorageMask {
     // Corresponds to quota::kStorageTypeTemporary.
-    kQuotaManagedTemporaryStorage = 1 << 0,
+    kQuotaManagedTemporaryStorage = 1 << 1,
 
     // Corresponds to quota::kStorageTypePersistent.
-    kQuotaManagedPersistentStorage = 1 << 1,
+    kQuotaManagedPersistentStorage = 1 << 2,
+
+    // Local dom storage.
+    kLocalDomStorage = 1 << 3,
+    kSessionDomStorage = 1 << 4,
+
+    // Local shader storage.
+    kShaderStorage = 1 << 5,
 
     // Corresponds to quota::kStorageTypeSyncable.
-    kQuotaManagedSyncableStorage = 1 << 2,
+    kQuotaManagedSyncableStorage = 1 << 6,
 
-    kAllStorage = -1
+    kAllStorage = -1,
   };
 
   // Starts an asynchronous task that does a best-effort clear the data
-  // corresponding to the given |remove_mask| and |quota_storage_remove_mask|
-  // inside this StoragePartition for the given |storage_origin|.
-  // Note session dom storage is not cleared even if you specify
-  // REMOVE_DATA_MASK_LOCAL_STORAGE.
+  // corresonding to the given |storage_mask| inside this StoragePartition for
+  // the given |storage_origin|. Note kSessionDomStorage is not cleared and the
+  // mask is ignored.
   //
   // TODO(ajwong): Right now, the embedder may have some
   // URLRequestContextGetter objects that the StoragePartition does not know
   // about.  This will no longer be the case when we resolve
   // http://crbug.com/159193. Remove |request_context_getter| when that bug
   // is fixed.
-  virtual void ClearDataForOrigin(uint32 remove_mask,
-                                  uint32 quota_storage_remove_mask,
-                                  const GURL& storage_origin,
-                                  net::URLRequestContextGetter* rq_context) = 0;
+  virtual void AsyncClearDataForOrigin(
+      uint32 storage_mask,
+      const GURL& storage_origin,
+      net::URLRequestContextGetter* request_context_getter) = 0;
 
-  // Similar to ClearDataForOrigin(), but deletes all data out of the
+  // Similar to AsyncClearDataForOrigin(), but deletes all data out of the
   // StoragePartition rather than just the data related to this origin.
-  virtual void ClearDataForUnboundedRange(uint32 remove_mask,
-                                          uint32 quota_storage_remove_mask) = 0;
+  virtual void AsyncClearData(uint32 storage_mask) = 0;
 
-  // Similar to ClearDataForOrigin(), but deletes all the data out of the
+  // Similar to AsyncClearDataForOrigin(), but deletes all the data out of the
   // StoragePartion from between the given |begin| and |end| dates rather
   // then just the data related to this origin.
-  virtual void ClearDataForRange(uint32 remove_mask,
-                                 uint32 quota_storage_remove_mask,
-                                 const base::Time& begin,
-                                 const base::Time& end,
-                                 const base::Closure& callback) = 0;
-
+  //
+  // Note: This currently only supports the shader cache.
+  virtual void AsyncClearDataBetween(uint32 storage_mask,
+                                     const base::Time& begin,
+                                     const base::Time& end,
+                                     const base::Closure& callback) = 0;
  protected:
   virtual ~StoragePartition() {}
 };
diff --git a/content/public/browser/utility_process_host.h b/content/public/browser/utility_process_host.h
index efd06b8..4c7e192 100644
--- a/content/public/browser/utility_process_host.h
+++ b/content/public/browser/utility_process_host.h
@@ -5,7 +5,7 @@
 #ifndef CONTENT_PUBLIC_BROWSER_UTILITY_PROCESS_HOST_H_
 #define CONTENT_PUBLIC_BROWSER_UTILITY_PROCESS_HOST_H_
 
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "content/common/content_export.h"
 #include "ipc/ipc_sender.h"
 
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
index 414067b..b7f67e4 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -5,9 +5,12 @@
 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_
 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_
 
+#include <set>
+
 #include "base/basictypes.h"
 #include "base/callback_forward.h"
-#include "base/process_util.h"
+#include "base/files/file_path.h"
+#include "base/process/kill.h"
 #include "base/strings/string16.h"
 #include "base/supports_user_data.h"
 #include "content/common/content_export.h"
diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h
index b6d2e9b..241a74b 100644
--- a/content/public/browser/web_contents_observer.h
+++ b/content/public/browser/web_contents_observer.h
@@ -5,8 +5,8 @@
 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_
 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_
 
-#include "base/process.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
+#include "base/process/process_handle.h"
 #include "content/common/content_export.h"
 #include "content/public/browser/navigation_controller.h"
 #include "content/public/common/page_transition_types.h"
diff --git a/content/public/browser/web_contents_view.h b/content/public/browser/web_contents_view.h
index 7e91bfa..d0594b7 100644
--- a/content/public/browser/web_contents_view.h
+++ b/content/public/browser/web_contents_view.h
@@ -8,7 +8,7 @@
 #include <string>
 
 #include "base/basictypes.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
 #include "content/common/content_export.h"
 #include "ui/gfx/native_widget_types.h"
 #include "ui/gfx/rect.h"
diff --git a/content/public/browser/worker_service.h b/content/public/browser/worker_service.h
index 0b066e3..10740fa 100644
--- a/content/public/browser/worker_service.h
+++ b/content/public/browser/worker_service.h
@@ -7,7 +7,7 @@
 
 #include <vector>
 
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/common/content_export.h"
 #include "url/gurl.h"
 
diff --git a/content/public/browser/worker_service_observer.h b/content/public/browser/worker_service_observer.h
index dbdebff..ff6c8ef 100644
--- a/content/public/browser/worker_service_observer.h
+++ b/content/public/browser/worker_service_observer.h
@@ -5,7 +5,7 @@
 #ifndef CONTENT_PUBLIC_BROWSER_WORKER_SERVICE_OBSERVER_H_
 #define CONTENT_PUBLIC_BROWSER_WORKER_SERVICE_OBSERVER_H_
 
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/strings/string16.h"
 
 class GURL;
diff --git a/content/public/browser/zygote_host_linux.h b/content/public/browser/zygote_host_linux.h
index 2dd1f80..a9798de 100644
--- a/content/public/browser/zygote_host_linux.h
+++ b/content/public/browser/zygote_host_linux.h
@@ -7,7 +7,7 @@
 
 #include <unistd.h>
 
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/common/content_export.h"
 
 namespace content {
diff --git a/content/public/common/common_param_traits_macros.h b/content/public/common/common_param_traits_macros.h
index e66daa7..a77c4c4 100644
--- a/content/public/common/common_param_traits_macros.h
+++ b/content/public/common/common_param_traits_macros.h
@@ -20,6 +20,7 @@
 #include "third_party/WebKit/public/platform/WebRect.h"
 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h"
 #include "third_party/WebKit/public/platform/WebURLRequest.h"
+#include "third_party/WebKit/public/web/WebWindowFeatures.h"
 #include "ui/base/window_open_disposition.h"
 #include "webkit/common/webpreferences.h"
 
@@ -204,4 +205,23 @@
 #endif
 IPC_STRUCT_TRAITS_END()
 
+IPC_STRUCT_TRAITS_BEGIN(WebKit::WebWindowFeatures)
+  IPC_STRUCT_TRAITS_MEMBER(x)
+  IPC_STRUCT_TRAITS_MEMBER(xSet)
+  IPC_STRUCT_TRAITS_MEMBER(y)
+  IPC_STRUCT_TRAITS_MEMBER(ySet)
+  IPC_STRUCT_TRAITS_MEMBER(width)
+  IPC_STRUCT_TRAITS_MEMBER(widthSet)
+  IPC_STRUCT_TRAITS_MEMBER(height)
+  IPC_STRUCT_TRAITS_MEMBER(heightSet)
+  IPC_STRUCT_TRAITS_MEMBER(menuBarVisible)
+  IPC_STRUCT_TRAITS_MEMBER(statusBarVisible)
+  IPC_STRUCT_TRAITS_MEMBER(toolBarVisible)
+  IPC_STRUCT_TRAITS_MEMBER(locationBarVisible)
+  IPC_STRUCT_TRAITS_MEMBER(scrollbarsVisible)
+  IPC_STRUCT_TRAITS_MEMBER(resizable)
+  IPC_STRUCT_TRAITS_MEMBER(fullscreen)
+  IPC_STRUCT_TRAITS_MEMBER(dialog)
+IPC_STRUCT_TRAITS_END()
+
 #endif  // CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_
diff --git a/content/public/common/gpu_memory_stats.h b/content/public/common/gpu_memory_stats.h
index e5e22f8..feb9ded 100644
--- a/content/public/common/gpu_memory_stats.h
+++ b/content/public/common/gpu_memory_stats.h
@@ -11,7 +11,7 @@
 #include <map>
 
 #include "base/basictypes.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/common/content_export.h"
 
 namespace content {
diff --git a/content/public/common/page_zoom.h b/content/public/common/page_zoom.h
index 8b0634d..aa5e56a 100644
--- a/content/public/common/page_zoom.h
+++ b/content/public/common/page_zoom.h
@@ -35,6 +35,10 @@
 // considered equal.
 CONTENT_EXPORT bool ZoomValuesEqual(double value_a, double value_b);
 
+// Converts between zoom factors and levels.
+CONTENT_EXPORT double ZoomLevelToZoomFactor(double zoom_level);
+CONTENT_EXPORT double ZoomFactorToZoomLevel(double factor);
+
 }  // namespace content
 
 #endif  // CONTENT_PUBLIC_COMMON_PAGE_ZOOM_H_
diff --git a/content/public/common/sandbox_init.h b/content/public/common/sandbox_init.h
index 7ae6dc4..8604322 100644
--- a/content/public/common/sandbox_init.h
+++ b/content/public/common/sandbox_init.h
@@ -6,7 +6,7 @@
 #define CONTENT_PUBLIC_COMMON_SANDBOX_INIT_H_
 
 #include "base/callback_forward.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "build/build_config.h"
 #include "content/common/content_export.h"
 
diff --git a/content/public/common/sandboxed_process_launcher_delegate.h b/content/public/common/sandboxed_process_launcher_delegate.h
index 5430f95..6357211 100644
--- a/content/public/common/sandboxed_process_launcher_delegate.h
+++ b/content/public/common/sandboxed_process_launcher_delegate.h
@@ -5,7 +5,7 @@
 #ifndef CONTENT_PUBLIC_COMMON_SANDBOXED_PROCESS_LAUNCHER_DELEGATE_H_
 #define CONTENT_PUBLIC_COMMON_SANDBOXED_PROCESS_LAUNCHER_DELEGATE_H_
 
-#include "base/process.h"
+#include "base/process/process.h"
 
 namespace base {
 class FilePath;
diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc
index 1d37ed4..1f9e45a 100644
--- a/content/public/renderer/content_renderer_client.cc
+++ b/content/public/renderer/content_renderer_client.cc
@@ -83,6 +83,10 @@
   return NULL;
 }
 
+WebKit::WebCrypto* ContentRendererClient::OverrideWebCrypto() {
+  return NULL;
+}
+
 bool ContentRendererClient::RunIdleHandlerWhenWidgetsHidden() {
   return true;
 }
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
index 080d5ca..e12d39b 100644
--- a/content/public/renderer/content_renderer_client.h
+++ b/content/public/renderer/content_renderer_client.h
@@ -28,6 +28,7 @@
 namespace WebKit {
 class WebAudioDevice;
 class WebClipboard;
+class WebCrypto;
 class WebFrame;
 class WebHyphenator;
 class WebMIDIAccessor;
@@ -158,6 +159,10 @@
   virtual WebKit::WebSpeechSynthesizer* OverrideSpeechSynthesizer(
       WebKit::WebSpeechSynthesizerClient* client);
 
+  // Allows the embedder to override the WebCrypto used.
+  // If it returns NULL the content layer will handle crypto.
+  virtual WebKit::WebCrypto* OverrideWebCrypto();
+
   // Returns true if the renderer process should schedule the idle handler when
   // all widgets are hidden.
   virtual bool RunIdleHandlerWhenWidgetsHidden();
diff --git a/content/public/renderer/ppapi_plugin_instance.h b/content/public/renderer/pepper_plugin_instance.h
similarity index 82%
rename from content/public/renderer/ppapi_plugin_instance.h
rename to content/public/renderer/pepper_plugin_instance.h
index 1e56e4c..211752d 100644
--- a/content/public/renderer/ppapi_plugin_instance.h
+++ b/content/public/renderer/pepper_plugin_instance.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_PUBLIC_PPAPI_PLUGIN_INSTANCE_H_
-#define CONTENT_PUBLIC_PPAPI_PLUGIN_INSTANCE_H_
+#ifndef CONTENT_PUBLIC_RENDERER_PEPPER_PLUGIN_INSTANCE_H_
+#define CONTENT_PUBLIC_RENDERER_PEPPER_PLUGIN_INSTANCE_H_
 
 #include "base/basictypes.h"
 #include "base/process/process_handle.h"
@@ -17,10 +17,6 @@
 class FilePath;
 }
 
-namespace content {
-class RenderView;
-}
-
 namespace gfx {
 class ImageSkia;
 class Rect;
@@ -40,20 +36,20 @@
 class WebPluginContainer;
 }
 
-namespace webkit {
-namespace ppapi {
+namespace content {
+class RenderView;
 
-class PluginInstance {
+class PepperPluginInstance {
  public:
-  static CONTENT_EXPORT PluginInstance* Get(PP_Instance instance_id);
+  static CONTENT_EXPORT PepperPluginInstance* Get(PP_Instance instance_id);
 
-  virtual ~PluginInstance() {}
+  virtual ~PepperPluginInstance() {}
 
   virtual content::RenderView* GetRenderView() = 0;
 
   virtual WebKit::WebPluginContainer* GetContainer() = 0;
 
-  virtual ::ppapi::VarTracker* GetVarTracker() = 0;
+  virtual ppapi::VarTracker* GetVarTracker() = 0;
 
   virtual const GURL& GetPluginURL() = 0;
 
@@ -72,7 +68,7 @@
   // Switches this instance with one that uses the out of process IPC proxy.
   virtual PP_ExternalPluginResult SwitchToOutOfProcessProxy(
       const base::FilePath& file_path,
-      ::ppapi::PpapiPermissions permissions,
+      ppapi::PpapiPermissions permissions,
       const IPC::ChannelHandle& channel_handle,
       base::ProcessId plugin_pid,
       int plugin_child_id) = 0;
@@ -93,13 +89,12 @@
 
   virtual bool IsRectTopmost(const gfx::Rect& rect) = 0;
 
-  virtual int32_t Navigate(const ::ppapi::URLRequestInfoData& request,
+  virtual int32_t Navigate(const ppapi::URLRequestInfoData& request,
                            const char* target,
                            bool from_user_action) = 0;
 
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
-#endif  // CONTENT_PUBLIC_PPAPI_PLUGIN_INSTANCE_H_
+#endif  // CONTENT_PUBLIC_RENDERER_PEPPER_PLUGIN_INSTANCE_H_
diff --git a/content/public/renderer/renderer_ppapi_host.h b/content/public/renderer/renderer_ppapi_host.h
index 5f3caac..329961e 100644
--- a/content/public/renderer/renderer_ppapi_host.h
+++ b/content/public/renderer/renderer_ppapi_host.h
@@ -8,7 +8,7 @@
 #include "base/callback_forward.h"
 #include "base/memory/ref_counted.h"
 #include "base/platform_file.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/common/content_export.h"
 #include "ipc/ipc_platform_file.h"
 #include "ppapi/c/pp_instance.h"
@@ -35,14 +35,8 @@
 class WebPluginContainer;
 }
 
-namespace webkit {
-namespace ppapi {
-class PluginInstance;
-}
-}
-
 namespace content {
-
+class PepperPluginInstance;
 class RenderView;
 
 // Interface that allows components in the embedder app to talk to the
@@ -66,7 +60,7 @@
   // Returns the PluginInstance for the given PP_Instance, or NULL if the
   // PP_Instance is invalid (the common case this will be invalid is during
   // plugin teardown when resource hosts are being force-freed).
-  virtual webkit::ppapi::PluginInstance* GetPluginInstance(
+  virtual PepperPluginInstance* GetPluginInstance(
       PP_Instance instance) const = 0;
 
   // Returns the RenderView for the given plugin instance, or NULL if the
diff --git a/content/public/test/browser_test_base.cc b/content/public/test/browser_test_base.cc
index 66918ab..d15e54b 100644
--- a/content/public/test/browser_test_base.cc
+++ b/content/public/test/browser_test_base.cc
@@ -7,7 +7,6 @@
 #include "base/bind.h"
 #include "base/command_line.h"
 #include "base/debug/stack_trace.h"
-#include "base/process_util.h"
 #include "content/browser/renderer_host/render_process_host_impl.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/common/content_switches.h"
@@ -15,6 +14,10 @@
 #include "content/public/test/test_utils.h"
 #include "net/test/embedded_test_server/embedded_test_server.h"
 
+#if defined(OS_POSIX)
+#include "base/process/process_handle.h"
+#endif
+
 #if defined(OS_MACOSX)
 #include "base/mac/mac_util.h"
 #include "base/power_monitor/power_monitor.h"
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc
index e64a7ab..c801cd5 100644
--- a/content/public/test/browser_test_utils.cc
+++ b/content/public/test/browser_test_utils.cc
@@ -7,7 +7,7 @@
 #include "base/command_line.h"
 #include "base/json/json_reader.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
 #include "base/rand_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/utf_string_conversions.h"
diff --git a/content/public/test/browser_test_utils.h b/content/public/test/browser_test_utils.h
index 83f3985..ece2805 100644
--- a/content/public/test/browser_test_utils.h
+++ b/content/public/test/browser_test_utils.h
@@ -13,7 +13,7 @@
 #include "base/compiler_specific.h"
 #include "base/files/scoped_temp_dir.h"
 #include "base/memory/ref_counted.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/strings/string16.h"
 #include "content/public/browser/notification_observer.h"
 #include "content/public/browser/notification_registrar.h"
diff --git a/content/public/test/mock_render_thread.cc b/content/public/test/mock_render_thread.cc
index be1caf2..ae10d82 100644
--- a/content/public/test/mock_render_thread.cc
+++ b/content/public/test/mock_render_thread.cc
@@ -5,7 +5,6 @@
 #include "content/public/test/mock_render_thread.h"
 
 #include "base/message_loop/message_loop_proxy.h"
-#include "base/process_util.h"
 #include "content/common/view_messages.h"
 #include "ipc/ipc_message_utils.h"
 #include "ipc/ipc_sync_message.h"
diff --git a/content/public/test/render_view_fake_resources_test.cc b/content/public/test/render_view_fake_resources_test.cc
index 20e96f5..3b9d35b 100644
--- a/content/public/test/render_view_fake_resources_test.cc
+++ b/content/public/test/render_view_fake_resources_test.cc
@@ -8,7 +8,7 @@
 
 #include "base/command_line.h"
 #include "base/memory/shared_memory.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/run_loop.h"
 #include "base/time/time.h"
 #include "content/common/resource_messages.h"
diff --git a/content/public/test/test_launcher.cc b/content/public/test/test_launcher.cc
index ae5abbd..0c3e355 100644
--- a/content/public/test/test_launcher.cc
+++ b/content/public/test/test_launcher.cc
@@ -15,7 +15,6 @@
 #include "base/logging.h"
 #include "base/memory/linked_ptr.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc
index 4483c58..835a24e 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -148,8 +148,6 @@
     IPC_MESSAGE_HANDLER(BrowserPluginMsg_GuestContentWindowReady,
                         OnGuestContentWindowReady)
     IPC_MESSAGE_HANDLER(BrowserPluginMsg_GuestGone, OnGuestGone)
-    IPC_MESSAGE_HANDLER(BrowserPluginMsg_GuestResponsive, OnGuestResponsive)
-    IPC_MESSAGE_HANDLER(BrowserPluginMsg_GuestUnresponsive, OnGuestUnresponsive)
     IPC_MESSAGE_HANDLER(BrowserPluginMsg_RequestPermission, OnRequestPermission)
     IPC_MESSAGE_HANDLER(BrowserPluginMsg_SetCursor, OnSetCursor)
     IPC_MESSAGE_HANDLER(BrowserPluginMsg_SetMouseLock, OnSetMouseLock)
@@ -485,18 +483,6 @@
                  weak_ptr_factory_.GetWeakPtr()));
 }
 
-void BrowserPlugin::OnGuestResponsive(int guest_instance_id, int process_id) {
-  std::map<std::string, base::Value*> props;
-  props[browser_plugin::kProcessId] = new base::FundamentalValue(process_id);
-  TriggerEvent(browser_plugin::kEventResponsive, &props);
-}
-
-void BrowserPlugin::OnGuestUnresponsive(int guest_instance_id, int process_id) {
-  std::map<std::string, base::Value*> props;
-  props[browser_plugin::kProcessId] = new base::FundamentalValue(process_id);
-  TriggerEvent(browser_plugin::kEventUnresponsive, &props);
-}
-
 void BrowserPlugin::OnRequestPermission(
     int guest_instance_id,
     BrowserPluginPermissionType permission_type,
@@ -1168,8 +1154,6 @@
     case BrowserPluginMsg_CompositorFrameSwapped::ID:
     case BrowserPluginMsg_GuestContentWindowReady::ID:
     case BrowserPluginMsg_GuestGone::ID:
-    case BrowserPluginMsg_GuestResponsive::ID:
-    case BrowserPluginMsg_GuestUnresponsive::ID:
     case BrowserPluginMsg_RequestPermission::ID:
     case BrowserPluginMsg_SetCursor::ID:
     case BrowserPluginMsg_SetMouseLock::ID:
diff --git a/content/renderer/media/crypto/content_decryption_module_factory.cc b/content/renderer/media/crypto/content_decryption_module_factory.cc
index 3138be2..3ce22f3 100644
--- a/content/renderer/media/crypto/content_decryption_module_factory.cc
+++ b/content/renderer/media/crypto/content_decryption_module_factory.cc
@@ -10,8 +10,8 @@
 
 #if defined(ENABLE_PEPPER_CDMS)
 #include "content/renderer/media/crypto/ppapi_decryptor.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
-#include "content/renderer/pepper/ppapi_webplugin_impl.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
+#include "content/renderer/pepper/pepper_webplugin_impl.h"
 #include "third_party/WebKit/public/platform/WebString.h"
 #include "third_party/WebKit/public/web/WebFrame.h"
 #include "third_party/WebKit/public/web/WebMediaPlayerClient.h"
@@ -23,10 +23,10 @@
 namespace content {
 
 #if defined(ENABLE_PEPPER_CDMS)
-// Returns the PluginInstanceImpl associated with the Helper Plugin.
+// Returns the PepperPluginInstanceImpl associated with the Helper Plugin.
 // If a non-NULL pointer is returned, the caller must call closeHelperPlugin()
 // when the Helper Plugin is no longer needed.
-static scoped_refptr<webkit::ppapi::PluginInstanceImpl> CreateHelperPlugin(
+static scoped_refptr<PepperPluginInstanceImpl> CreateHelperPlugin(
     const std::string& plugin_type,
     WebKit::WebMediaPlayerClient* web_media_player_client,
     WebKit::WebFrame* web_frame) {
@@ -40,8 +40,8 @@
 
   DCHECK(!web_plugin->isPlaceholder());  // Prevented by Blink.
   // Only Pepper plugins are supported, so it must be a ppapi object.
-  webkit::ppapi::WebPluginImpl* ppapi_plugin =
-      static_cast<webkit::ppapi::WebPluginImpl*>(web_plugin);
+  PepperWebPluginImpl* ppapi_plugin =
+      static_cast<PepperWebPluginImpl*>(web_plugin);
   return ppapi_plugin->instance();
 }
 
@@ -58,7 +58,7 @@
 
   std::string plugin_type = GetPepperType(key_system);
   DCHECK(!plugin_type.empty());
-  const scoped_refptr<webkit::ppapi::PluginInstanceImpl>& plugin_instance =
+  const scoped_refptr<PepperPluginInstanceImpl>& plugin_instance =
       CreateHelperPlugin(plugin_type, web_media_player_client, web_frame);
   if (!plugin_instance.get()) {
     DLOG(ERROR) << "ProxyDecryptor: plugin instance creation failed.";
diff --git a/content/renderer/media/crypto/ppapi_decryptor.cc b/content/renderer/media/crypto/ppapi_decryptor.cc
index 7bf2aab..8d5bdf9 100644
--- a/content/renderer/media/crypto/ppapi_decryptor.cc
+++ b/content/renderer/media/crypto/ppapi_decryptor.cc
@@ -13,7 +13,7 @@
 #include "base/message_loop/message_loop.h"
 #include "base/message_loop/message_loop_proxy.h"
 #include "content/renderer/pepper/content_decryptor_delegate.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "media/base/audio_decoder_config.h"
 #include "media/base/data_buffer.h"
 #include "media/base/decoder_buffer.h"
@@ -24,12 +24,12 @@
 
 scoped_ptr<PpapiDecryptor> PpapiDecryptor::Create(
     const std::string& key_system,
-    const scoped_refptr<webkit::ppapi::PluginInstanceImpl>& plugin_instance,
+    const scoped_refptr<PepperPluginInstanceImpl>& plugin_instance,
     const media::KeyAddedCB& key_added_cb,
     const media::KeyErrorCB& key_error_cb,
     const media::KeyMessageCB& key_message_cb,
     const base::Closure& destroy_plugin_cb) {
-  webkit::ppapi::ContentDecryptorDelegate* plugin_cdm_delegate =
+  ContentDecryptorDelegate* plugin_cdm_delegate =
       plugin_instance->GetContentDecryptorDelegate();
   if (!plugin_cdm_delegate) {
     DVLOG(1) << "PpapiDecryptor: plugin cdm delegate creation failed.";
@@ -47,8 +47,8 @@
 }
 
 PpapiDecryptor::PpapiDecryptor(
-    const scoped_refptr<webkit::ppapi::PluginInstanceImpl>& plugin_instance,
-    webkit::ppapi::ContentDecryptorDelegate* plugin_cdm_delegate,
+    const scoped_refptr<PepperPluginInstanceImpl>& plugin_instance,
+    ContentDecryptorDelegate* plugin_cdm_delegate,
     const media::KeyAddedCB& key_added_cb,
     const media::KeyErrorCB& key_error_cb,
     const media::KeyMessageCB& key_message_cb,
diff --git a/content/renderer/media/crypto/ppapi_decryptor.h b/content/renderer/media/crypto/ppapi_decryptor.h
index 39c84af..327ecc6 100644
--- a/content/renderer/media/crypto/ppapi_decryptor.h
+++ b/content/renderer/media/crypto/ppapi_decryptor.h
@@ -19,14 +19,9 @@
 class MessageLoopProxy;
 }
 
-namespace webkit {
-namespace ppapi {
-class ContentDecryptorDelegate;
-class PluginInstanceImpl;
-}
-}
-
 namespace content {
+class ContentDecryptorDelegate;
+class PepperPluginInstanceImpl;
 
 // PpapiDecryptor implements media::Decryptor and forwards all calls to the
 // PluginInstance.
@@ -36,7 +31,7 @@
   static scoped_ptr<PpapiDecryptor> Create(
       // TODO(ddorwin): Remove after updating the delegate.
       const std::string& key_system,
-      const scoped_refptr<webkit::ppapi::PluginInstanceImpl>& plugin_instance,
+      const scoped_refptr<PepperPluginInstanceImpl>& plugin_instance,
       const media::KeyAddedCB& key_added_cb,
       const media::KeyErrorCB& key_error_cb,
       const media::KeyMessageCB& key_message_cb,
@@ -76,8 +71,8 @@
 
  private:
   PpapiDecryptor(
-      const scoped_refptr<webkit::ppapi::PluginInstanceImpl>& plugin_instance,
-      webkit::ppapi::ContentDecryptorDelegate* plugin_cdm_delegate,
+      const scoped_refptr<PepperPluginInstanceImpl>& plugin_instance,
+      ContentDecryptorDelegate* plugin_cdm_delegate,
       const media::KeyAddedCB& key_added_cb,
       const media::KeyErrorCB& key_error_cb,
       const media::KeyMessageCB& key_message_cb,
@@ -99,9 +94,9 @@
   // Hold a reference of the plugin instance to make sure the plugin outlives
   // the |plugin_cdm_delegate_|. This is needed because |plugin_cdm_delegate_|
   // is owned by the |plugin_instance_|.
-  scoped_refptr<webkit::ppapi::PluginInstanceImpl> plugin_instance_;
+  scoped_refptr<PepperPluginInstanceImpl> plugin_instance_;
 
-  webkit::ppapi::ContentDecryptorDelegate* plugin_cdm_delegate_;
+  ContentDecryptorDelegate* plugin_cdm_delegate_;
 
   // Callbacks for firing key events.
   media::KeyAddedCB key_added_cb_;
diff --git a/content/renderer/media/midi_dispatcher.cc b/content/renderer/media/midi_dispatcher.cc
new file mode 100644
index 0000000..f3485b4
--- /dev/null
+++ b/content/renderer/media/midi_dispatcher.cc
@@ -0,0 +1,58 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/renderer/media/midi_dispatcher.h"
+
+#include "base/bind.h"
+#include "base/message_loop/message_loop.h"
+#include "content/common/media/midi_messages.h"
+#include "content/renderer/render_view_impl.h"
+#include "third_party/WebKit/public/web/WebMIDIPermissionRequest.h"
+
+using WebKit::WebMIDIPermissionRequest;
+
+namespace content {
+
+MIDIDispatcher::MIDIDispatcher(RenderViewImpl* render_view)
+    : RenderViewObserver(render_view) {
+}
+
+MIDIDispatcher::~MIDIDispatcher() {}
+
+bool MIDIDispatcher::OnMessageReceived(const IPC::Message& message) {
+  // TODO(toyoshim): Handle MIDIMsg_SysExPermissionApproved.
+  return false;
+}
+
+void MIDIDispatcher::requestSysExPermission(
+      const WebMIDIPermissionRequest& request) {
+  // TODO(toyoshim): Send a message to MIDIDispatcherHost to handle correctly.
+  int client_id = requests_.Add(new WebMIDIPermissionRequest(request));
+  base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(
+      &MIDIDispatcher::OnSysExPermissionApproved,
+      base::Unretained(this), client_id, false));
+}
+
+void MIDIDispatcher::cancelSysExPermissionRequest(
+    const WebMIDIPermissionRequest& request) {
+  for (IDMap<WebMIDIPermissionRequest>::iterator it(&requests_);
+       !it.IsAtEnd();
+       it.Advance()) {
+    WebMIDIPermissionRequest* value = it.GetCurrentValue();
+    if (!value->equals(request))
+      continue;
+    requests_.Remove(it.GetCurrentKey());
+  }
+}
+
+void MIDIDispatcher::OnSysExPermissionApproved(int client_id, bool is_allowed) {
+  // |request| can be NULL when the request is canceled.
+  WebMIDIPermissionRequest* request = requests_.Lookup(client_id);
+  if (!request)
+    return;
+  request->setIsAllowed(is_allowed);
+  requests_.Remove(client_id);
+}
+
+}  // namespace content
diff --git a/content/renderer/media/midi_dispatcher.h b/content/renderer/media/midi_dispatcher.h
new file mode 100644
index 0000000..143d706
--- /dev/null
+++ b/content/renderer/media/midi_dispatcher.h
@@ -0,0 +1,54 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_RENDERER_MEDIA_MIDI_DISPATCHER_H_
+#define CONTENT_RENDERER_MEDIA_MIDI_DISPATCHER_H_
+
+#include "base/id_map.h"
+#include "content/public/renderer/render_view_observer.h"
+#include "third_party/WebKit/public/web/WebMIDIClient.h"
+
+namespace WebKit {
+class WebMIDIPermissionRequest;
+}
+
+namespace content {
+
+class RenderViewImpl;
+
+// MIDIDispatcher implements WebMIDIClient to handle permissions for using
+// system exclusive messages.
+// It works as RenderViewObserver to handle IPC messages between
+// MIDIDispatcherHost owned by RenderViewHost since permissions are managed in
+// the browser process.
+class MIDIDispatcher : public RenderViewObserver,
+                       public WebKit::WebMIDIClient {
+ public:
+  explicit MIDIDispatcher(RenderViewImpl* render_view);
+  virtual ~MIDIDispatcher();
+
+ private:
+  // RenderView::Observer implementation.
+  virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+
+  // WebKit::WebMIDIClient implementation.
+  virtual void requestSysExPermission(
+      const WebKit::WebMIDIPermissionRequest& request) OVERRIDE;
+  virtual void cancelSysExPermissionRequest(
+      const WebKit::WebMIDIPermissionRequest& request) OVERRIDE;
+
+  // Permission for using system exclusive messages has been set.
+  void OnSysExPermissionApproved(int client_id, bool is_allowed);
+
+  // Each WebMIDIPermissionRequest object is valid until
+  // cancelSysExPermissionRequest() is called with the object, or used to call
+  // WebMIDIPermissionRequest::setIsAllowed().
+  IDMap<WebKit::WebMIDIPermissionRequest> requests_;
+
+  DISALLOW_COPY_AND_ASSIGN(MIDIDispatcher);
+};
+
+}  // namespace content
+
+#endif  // CONTENT_RENDERER_MEDIA_MIDI_DISPATCHER_H_
diff --git a/content/renderer/media/midi_message_filter.cc b/content/renderer/media/midi_message_filter.cc
index 73b261d..3586d30 100644
--- a/content/renderer/media/midi_message_filter.cc
+++ b/content/renderer/media/midi_message_filter.cc
@@ -40,7 +40,7 @@
   DCHECK(io_message_loop_->BelongsToCurrentThread());
   bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(MIDIMessageFilter, message)
-    IPC_MESSAGE_HANDLER(MIDIMsg_AccessApproved, OnAccessApproved)
+    IPC_MESSAGE_HANDLER(MIDIMsg_SessionStarted, OnSessionStarted)
     IPC_MESSAGE_HANDLER(MIDIMsg_DataReceived, OnDataReceived)
     IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
@@ -65,8 +65,7 @@
   channel_ = NULL;
 }
 
-void MIDIMessageFilter::RequestAccess(
-    WebKit::WebMIDIAccessorClient* client, int access) {
+void MIDIMessageFilter::StartSession(WebKit::WebMIDIAccessorClient* client) {
   // Generate and keep track of a "client id" which is sent to the browser
   // to ask permission to talk to MIDI hardware.
   // This id is handed back when we receive the answer in OnAccessApproved().
@@ -75,13 +74,13 @@
     clients_[client] = client_id;
 
     io_message_loop_->PostTask(FROM_HERE,
-        base::Bind(&MIDIMessageFilter::RequestAccessOnIOThread, this,
-                   client_id, access));
+        base::Bind(&MIDIMessageFilter::StartSessionOnIOThread, this,
+                   client_id));
   }
 }
 
-void MIDIMessageFilter::RequestAccessOnIOThread(int client_id, int access) {
-  Send(new MIDIHostMsg_RequestAccess(client_id, access));
+void MIDIMessageFilter::StartSessionOnIOThread(int client_id) {
+  Send(new MIDIHostMsg_StartSession(client_id));
 }
 
 void MIDIMessageFilter::RemoveClient(WebKit::WebMIDIAccessorClient* client) {
@@ -92,22 +91,20 @@
 
 // Received from browser.
 
-void MIDIMessageFilter::OnAccessApproved(
+void MIDIMessageFilter::OnSessionStarted(
     int client_id,
-    int access,
     bool success,
     MIDIPortInfoList inputs,
     MIDIPortInfoList outputs) {
   // Handle on the main JS thread.
   main_message_loop_->PostTask(
       FROM_HERE,
-      base::Bind(&MIDIMessageFilter::HandleAccessApproved, this,
-                 client_id, access, success, inputs, outputs));
+      base::Bind(&MIDIMessageFilter::HandleSessionStarted, this,
+                 client_id, success, inputs, outputs));
 }
 
-void MIDIMessageFilter::HandleAccessApproved(
+void MIDIMessageFilter::HandleSessionStarted(
     int client_id,
-    int access,
     bool success,
     MIDIPortInfoList inputs,
     MIDIPortInfoList outputs) {
@@ -133,11 +130,10 @@
           UTF8ToUTF16(outputs[i].version));
     }
   }
-
-  if (success)
-    client->didAllowAccess();
-  else
-    client->didBlockAccess();
+  // TODO(toyoshim): Reports device initialization failure to JavaScript as
+  // "NotSupportedError" or something when |success| is false.
+  // http://crbug.com/260315
+  client->didStartSession();
 }
 
 WebKit::WebMIDIAccessorClient*
diff --git a/content/renderer/media/midi_message_filter.h b/content/renderer/media/midi_message_filter.h
index c34ce53..0daceb0 100644
--- a/content/renderer/media/midi_message_filter.h
+++ b/content/renderer/media/midi_message_filter.h
@@ -32,7 +32,7 @@
   // If permission is granted, then the client's
   // addInputPort() and addOutputPort() methods will be called,
   // giving the client access to receive and send data.
-  void RequestAccess(WebKit::WebMIDIAccessorClient* client, int access);
+  void StartSession(WebKit::WebMIDIAccessorClient* client);
   void RemoveClient(WebKit::WebMIDIAccessorClient* client);
 
   // A client will only be able to call this method if it has a suitable
@@ -62,8 +62,7 @@
 
   // Called when the browser process has approved (or denied) access to
   // MIDI hardware.
-  void OnAccessApproved(int client_id,
-                        int access,
+  void OnSessionStarted(int client_id,
                         bool success,
                         media::MIDIPortInfoList inputs,
                         media::MIDIPortInfoList outputs);
@@ -74,8 +73,7 @@
                       const std::vector<uint8>& data,
                       double timestamp);
 
-  void HandleAccessApproved(int client_id,
-                            int access,
+  void HandleSessionStarted(int client_id,
                             bool success,
                             media::MIDIPortInfoList inputs,
                             media::MIDIPortInfoList outputs);
@@ -84,7 +82,7 @@
                           const std::vector<uint8>& data,
                           double timestamp);
 
-  void RequestAccessOnIOThread(int client_id, int access);
+  void StartSessionOnIOThread(int client_id);
 
   void SendMIDIDataOnIOThread(int port,
                               const std::vector<uint8>& data,
diff --git a/content/renderer/media/pepper_platform_video_decoder_impl.h b/content/renderer/media/pepper_platform_video_decoder_impl.h
index d3fc9a9..b63fdcd 100644
--- a/content/renderer/media/pepper_platform_video_decoder_impl.h
+++ b/content/renderer/media/pepper_platform_video_decoder_impl.h
@@ -16,7 +16,7 @@
 namespace content {
 
 class PlatformVideoDecoderImpl
-    : public webkit::ppapi::PluginDelegate::PlatformVideoDecoder,
+    : public PluginDelegate::PlatformVideoDecoder,
       public media::VideoDecodeAccelerator::Client {
  public:
   PlatformVideoDecoderImpl(
diff --git a/content/renderer/media/renderer_webmidiaccessor_impl.cc b/content/renderer/media/renderer_webmidiaccessor_impl.cc
index 0a8b68f..de9db93 100644
--- a/content/renderer/media/renderer_webmidiaccessor_impl.cc
+++ b/content/renderer/media/renderer_webmidiaccessor_impl.cc
@@ -20,8 +20,8 @@
   midi_message_filter()->RemoveClient(client_);
 }
 
-void RendererWebMIDIAccessorImpl::requestAccess(bool access) {
-  midi_message_filter()->RequestAccess(client_, access ? 1 : 0);
+void RendererWebMIDIAccessorImpl::startSession() {
+  midi_message_filter()->StartSession(client_);
 }
 
 void RendererWebMIDIAccessorImpl::sendMIDIData(
diff --git a/content/renderer/media/renderer_webmidiaccessor_impl.h b/content/renderer/media/renderer_webmidiaccessor_impl.h
index a6a07c9..7032943 100644
--- a/content/renderer/media/renderer_webmidiaccessor_impl.h
+++ b/content/renderer/media/renderer_webmidiaccessor_impl.h
@@ -22,11 +22,11 @@
   virtual ~RendererWebMIDIAccessorImpl();
 
   // WebKit::WebMIDIAccessor implementation.
-  virtual void requestAccess(bool access) OVERRIDE;
+  virtual void startSession();
   virtual void sendMIDIData(unsigned port_index,
                             const unsigned char* data,
                             size_t length,
-                            double timestamp) OVERRIDE;
+                            double timestamp);
 
  private:
   WebKit::WebMIDIAccessorClient* client_;
diff --git a/content/renderer/media/video_destination_handler.cc b/content/renderer/media/video_destination_handler.cc
index 81ab07f..7438c49 100644
--- a/content/renderer/media/video_destination_handler.cc
+++ b/content/renderer/media/video_destination_handler.cc
@@ -18,7 +18,6 @@
 
 using cricket::CaptureState;
 using cricket::VideoFormat;
-using webkit::ppapi::PPB_ImageData_Impl;
 using webrtc::VideoTrackInterface;
 using webrtc::VideoTrackVector;
 
@@ -100,7 +99,7 @@
     LOG(ERROR) << "PpFrameWriter::PutFrame - Called with NULL image_data.";
     return;
   }
-  webkit::ppapi::ImageDataAutoMapper mapper(image_data);
+  ImageDataAutoMapper mapper(image_data);
   if (!mapper.is_valid()) {
     LOG(ERROR) << "PpFrameWriter::PutFrame - "
                << "The image could not be mapped and is unusable.";
@@ -148,7 +147,7 @@
 
   virtual ~PpFrameWriterProxy() {}
 
-  virtual void PutFrame(webkit::ppapi::PPB_ImageData_Impl* image_data,
+  virtual void PutFrame(PPB_ImageData_Impl* image_data,
                         int64 time_stamp_ns) OVERRIDE {
     writer_->PutFrame(image_data, time_stamp_ns);
   }
diff --git a/content/renderer/media/video_destination_handler.h b/content/renderer/media/video_destination_handler.h
index 68b1a6c..087d3ac 100644
--- a/content/renderer/media/video_destination_handler.h
+++ b/content/renderer/media/video_destination_handler.h
@@ -13,16 +13,11 @@
 #include "content/common/content_export.h"
 #include "third_party/libjingle/source/talk/media/base/videocapturer.h"
 
-namespace webkit {
-namespace ppapi {
-class PPB_ImageData_Impl;
-}
-}
-
 namespace content {
 
 class MediaStreamDependencyFactory;
 class MediaStreamRegistryInterface;
+class PPB_ImageData_Impl;
 
 // Interface used by the effects pepper plugin to output the processed frame
 // to the video track.
@@ -30,7 +25,7 @@
  public:
   // The ownership of the |image_data| deosn't transfer. So the implementation
   // of this interface should make a copy of the |image_data| before return.
-  virtual void PutFrame(webkit::ppapi::PPB_ImageData_Impl* image_data,
+  virtual void PutFrame(PPB_ImageData_Impl* image_data,
                         int64 time_stamp_ns) = 0;
   virtual ~FrameWriterInterface() {}
 };
@@ -59,7 +54,7 @@
 
   // FrameWriterInterface implementation.
   // This method will be called by the Pepper host from render thread.
-  virtual void PutFrame(webkit::ppapi::PPB_ImageData_Impl* image_data,
+  virtual void PutFrame(PPB_ImageData_Impl* image_data,
                         int64 time_stamp_ns) OVERRIDE;
 
  private:
diff --git a/content/renderer/media/webmediaplayer_impl.cc b/content/renderer/media/webmediaplayer_impl.cc
index dac94c6..7cece16 100644
--- a/content/renderer/media/webmediaplayer_impl.cc
+++ b/content/renderer/media/webmediaplayer_impl.cc
@@ -28,7 +28,7 @@
 #include "content/renderer/media/webmediaplayer_params.h"
 #include "content/renderer/media/webmediaplayer_util.h"
 #include "content/renderer/media/webmediasourceclient_impl.h"
-#include "content/renderer/pepper/ppapi_webplugin_impl.h"
+#include "content/renderer/pepper/pepper_webplugin_impl.h"
 #include "gpu/GLES2/gl2extchromium.h"
 #include "media/audio/null_audio_sink.h"
 #include "media/base/bind_to_loop.h"
diff --git a/content/renderer/pepper/audio_helper.cc b/content/renderer/pepper/audio_helper.cc
index 7eb0d87..8197d7a 100644
--- a/content/renderer/pepper/audio_helper.cc
+++ b/content/renderer/pepper/audio_helper.cc
@@ -10,8 +10,7 @@
 
 using ppapi::TrackedCallback;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 // AudioHelper -----------------------------------------------------------------
 
@@ -84,5 +83,4 @@
   create_callback_ = create_callback;
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
\ No newline at end of file
diff --git a/content/renderer/pepper/audio_helper.h b/content/renderer/pepper/audio_helper.h
index 854ac9a..7ffeb24 100644
--- a/content/renderer/pepper/audio_helper.h
+++ b/content/renderer/pepper/audio_helper.h
@@ -15,8 +15,7 @@
 #include "ppapi/shared_impl/scoped_pp_resource.h"
 #include "ppapi/shared_impl/tracked_callback.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class AudioHelper : public PluginDelegate::PlatformAudioOutputClient {
  public:
@@ -57,7 +56,6 @@
   DISALLOW_COPY_AND_ASSIGN(AudioHelper);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_AUDIO_HELPER_H_
diff --git a/content/renderer/pepper/common.h b/content/renderer/pepper/common.h
index ed51b62..9b440bf 100644
--- a/content/renderer/pepper/common.h
+++ b/content/renderer/pepper/common.h
@@ -8,8 +8,7 @@
 #include "ppapi/c/pp_bool.h"
 #include "ppapi/c/pp_var.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 inline PP_Bool BoolToPPBool(bool value) {
   return value ? PP_TRUE : PP_FALSE;
@@ -19,8 +18,7 @@
   return (PP_TRUE == value);
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_COMMON_H_
 
diff --git a/content/renderer/pepper/content_decryptor_delegate.cc b/content/renderer/pepper/content_decryptor_delegate.cc
index 79d9cff..22c3aff 100644
--- a/content/renderer/pepper/content_decryptor_delegate.cc
+++ b/content/renderer/pepper/content_decryptor_delegate.cc
@@ -33,8 +33,7 @@
 using ppapi::thunk::EnterResourceNoLock;
 using ppapi::thunk::PPB_Buffer_API;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 
@@ -1047,5 +1046,4 @@
   return true;
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/content_decryptor_delegate.h b/content/renderer/pepper/content_decryptor_delegate.h
index 8f7ad31..ca54d98 100644
--- a/content/renderer/pepper/content_decryptor_delegate.h
+++ b/content/renderer/pepper/content_decryptor_delegate.h
@@ -25,8 +25,7 @@
 class VideoDecoderConfig;
 }
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class PPB_Buffer_Impl;
 
@@ -189,7 +188,6 @@
   DISALLOW_COPY_AND_ASSIGN(ContentDecryptorDelegate);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_CONTENT_DECRYPTOR_DELEGATE_H_
diff --git a/content/renderer/pepper/content_renderer_pepper_host_factory.cc b/content/renderer/pepper/content_renderer_pepper_host_factory.cc
index d7872c9..983e185 100644
--- a/content/renderer/pepper/content_renderer_pepper_host_factory.cc
+++ b/content/renderer/pepper/content_renderer_pepper_host_factory.cc
@@ -33,9 +33,10 @@
 using ppapi::proxy::SerializedTrueTypeFontDesc;
 using ppapi::UnpackMessage;
 
+namespace content {
 namespace {
 
-bool CanUseMediaStreamAPI(const content::RendererPpapiHost* host,
+bool CanUseMediaStreamAPI(const RendererPpapiHost* host,
                           PP_Instance instance) {
   WebKit::WebPluginContainer* container =
       host->GetContainerForInstance(instance);
@@ -43,15 +44,13 @@
     return false;
 
   GURL document_url = container->element().document().url();
-  content::ContentRendererClient* content_renderer_client =
-      content::GetContentClient()->renderer();
+  ContentRendererClient* content_renderer_client =
+      GetContentClient()->renderer();
   return content_renderer_client->AllowPepperMediaStreamAPI(document_url);
 }
 
 }
 
-namespace content {
-
 ContentRendererPepperHostFactory::ContentRendererPepperHostFactory(
     RendererPpapiHostImpl* host)
     : host_(host) {
diff --git a/content/renderer/pepper/event_conversion.cc b/content/renderer/pepper/event_conversion.cc
index f912ae5..8020d5a 100644
--- a/content/renderer/pepper/event_conversion.cc
+++ b/content/renderer/pepper/event_conversion.cc
@@ -35,8 +35,7 @@
 using WebKit::WebTouchPoint;
 using WebKit::WebUChar;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 
@@ -731,5 +730,4 @@
   }
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/event_conversion.h b/content/renderer/pepper/event_conversion.h
index 0fa849c..05bdda8 100644
--- a/content/renderer/pepper/event_conversion.h
+++ b/content/renderer/pepper/event_conversion.h
@@ -22,8 +22,7 @@
 class WebInputEvent;
 }
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 // Converts the given WebKit event to one or possibly multiple PP_InputEvents.
 // The generated events will be filled into the given vector. On failure, no
@@ -48,7 +47,6 @@
 // type should not be "Undefined" since there's no corresponding PPAPI class.
 PP_InputEvent_Class ClassifyInputEvent(WebKit::WebInputEvent::Type type);
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_EVENT_CONVERSION_H_
diff --git a/content/renderer/pepper/fullscreen_container.h b/content/renderer/pepper/fullscreen_container.h
index 805c187..e3c030f 100644
--- a/content/renderer/pepper/fullscreen_container.h
+++ b/content/renderer/pepper/fullscreen_container.h
@@ -13,8 +13,7 @@
 struct WebRect;
 }  // namespace WebKit
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 // This class is like a lightweight WebPluginContainer for fullscreen PPAPI
 // plugins, that only handles painting.
@@ -42,7 +41,6 @@
   virtual ~FullscreenContainer() {}
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_FULLSCREEN_CONTAINER_IMPL_H_
diff --git a/content/renderer/pepper/gfx_conversion.h b/content/renderer/pepper/gfx_conversion.h
index 77e7001..3b504ba 100644
--- a/content/renderer/pepper/gfx_conversion.h
+++ b/content/renderer/pepper/gfx_conversion.h
@@ -15,8 +15,7 @@
 // Conversions for graphics types between our gfx library and PPAPI.
 // The style of naming is to match the PP_Bool conversions.
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 inline gfx::Point PP_ToGfxPoint(const PP_Point& p) {
   return gfx::Point(p.x, p.y);
@@ -42,7 +41,6 @@
   return PP_MakeSize(s.width(), s.height());
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_GFX_CONVERSION_H_
diff --git a/content/renderer/pepper/host_array_buffer_var.cc b/content/renderer/pepper/host_array_buffer_var.cc
index 565db42..e8d349e 100644
--- a/content/renderer/pepper/host_array_buffer_var.cc
+++ b/content/renderer/pepper/host_array_buffer_var.cc
@@ -9,17 +9,16 @@
 
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
 #include "content/renderer/pepper/host_globals.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/plugin_module.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "ppapi/c/pp_instance.h"
 
 using ppapi::ArrayBufferVar;
 using WebKit::WebArrayBuffer;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 HostArrayBufferVar::HostArrayBufferVar(uint32 size_in_bytes)
     : buffer_(WebArrayBuffer::create(size_in_bytes, 1 /* element_size */)),
@@ -63,8 +62,7 @@
     PP_Instance instance,
     int* host_shm_handle_id,
     base::SharedMemoryHandle* plugin_shm_handle) {
-  webkit::ppapi::PluginInstanceImpl* i =
-      webkit::ppapi::HostGlobals::Get()->GetInstance(instance);
+  PepperPluginInstanceImpl* i = HostGlobals::Get()->GetInstance(instance);
   scoped_ptr<base::SharedMemory> shm(i->delegate()->CreateAnonymousSharedMemory(
       ByteLength()));
   if (!shm)
@@ -99,5 +97,4 @@
   return true;
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/host_array_buffer_var.h b/content/renderer/pepper/host_array_buffer_var.h
index b1bd16a..9388c4e 100644
--- a/content/renderer/pepper/host_array_buffer_var.h
+++ b/content/renderer/pepper/host_array_buffer_var.h
@@ -11,8 +11,7 @@
 #include "ppapi/shared_impl/var.h"
 #include "third_party/WebKit/public/platform/WebArrayBuffer.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 // Represents a host-side ArrayBufferVar.
 class HostArrayBufferVar : public ::ppapi::ArrayBufferVar {
@@ -43,7 +42,6 @@
   DISALLOW_COPY_AND_ASSIGN(HostArrayBufferVar);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // PPAPI_CONTENT_RENDERER_PEPPER_HOST_ARRAY_BUFFER_VAR_H_
diff --git a/content/renderer/pepper/host_globals.cc b/content/renderer/pepper/host_globals.cc
index ccc9f84..78790e1 100644
--- a/content/renderer/pepper/host_globals.cc
+++ b/content/renderer/pepper/host_globals.cc
@@ -11,8 +11,8 @@
 #include "base/rand_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/task_runner.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/plugin_module.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "ppapi/shared_impl/api_id.h"
 #include "ppapi/shared_impl/id_assignment.h"
 #include "third_party/WebKit/public/platform/WebString.h"
@@ -30,8 +30,7 @@
 using WebKit::WebConsoleMessage;
 using WebKit::WebString;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 
@@ -119,14 +118,14 @@
 
 ::ppapi::thunk::ResourceCreationAPI* HostGlobals::GetResourceCreationAPI(
     PP_Instance pp_instance) {
-  PluginInstanceImpl* instance = GetInstance(pp_instance);
+  PepperPluginInstanceImpl* instance = GetInstance(pp_instance);
   if (!instance)
     return NULL;
   return &instance->resource_creation();
 }
 
 PP_Module HostGlobals::GetModuleForInstance(PP_Instance instance) {
-  PluginInstanceImpl* inst = GetInstance(instance);
+  PepperPluginInstanceImpl* inst = GetInstance(instance);
   if (!inst)
     return 0;
   return inst->module()->pp_module();
@@ -150,7 +149,7 @@
                                 PP_LogLevel level,
                                 const std::string& source,
                                 const std::string& value) {
-  PluginInstanceImpl* instance_object =
+  PepperPluginInstanceImpl* instance_object =
       HostGlobals::Get()->GetInstance(instance);
   if (instance_object) {
     instance_object->container()->element().document().frame()->
@@ -186,7 +185,8 @@
 }
 
 base::TaskRunner* HostGlobals::GetFileTaskRunner(PP_Instance instance) {
-  scoped_refptr<PluginInstanceImpl> plugin_instance = GetInstance(instance);
+  scoped_refptr<PepperPluginInstanceImpl> plugin_instance =
+      GetInstance(instance);
   DCHECK(plugin_instance.get());
   scoped_refptr<base::MessageLoopProxy> message_loop =
       plugin_instance->delegate()->GetFileThreadMessageLoopProxy();
@@ -236,7 +236,7 @@
   return found->second;
 }
 
-PP_Instance HostGlobals::AddInstance(PluginInstanceImpl* instance) {
+PP_Instance HostGlobals::AddInstance(PepperPluginInstanceImpl* instance) {
   DCHECK(instance_map_.find(instance->pp_instance()) == instance_map_.end());
 
   // Use a random number for the instance ID. This helps prevent some
@@ -268,7 +268,7 @@
   host_var_tracker_.DidDeleteInstance(instance);
 }
 
-PluginInstanceImpl* HostGlobals::GetInstance(PP_Instance instance) {
+PepperPluginInstanceImpl* HostGlobals::GetInstance(PP_Instance instance) {
   DLOG_IF(ERROR, !CheckIdType(instance, ::ppapi::PP_ID_TYPE_INSTANCE))
       << instance << " is not a PP_Instance.";
   InstanceMap::iterator found = instance_map_.find(instance);
@@ -281,5 +281,4 @@
   return true;
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/host_globals.h b/content/renderer/pepper/host_globals.h
index 1689259..f48eb05 100644
--- a/content/renderer/pepper/host_globals.h
+++ b/content/renderer/pepper/host_globals.h
@@ -12,10 +12,9 @@
 #include "ppapi/shared_impl/resource_tracker.h"
 #include "ppapi/shared_impl/var_tracker.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
-class PluginInstanceImpl;
+class PepperPluginInstanceImpl;
 class PluginModule;
 
 class HostGlobals : public ::ppapi::PpapiGlobals {
@@ -78,7 +77,7 @@
 
   // Adds a new plugin instance to the list of tracked instances, and returns a
   // new instance handle to identify it.
-  PP_Instance AddInstance(PluginInstanceImpl* instance);
+  PP_Instance AddInstance(PepperPluginInstanceImpl* instance);
 
   // Called when a plugin instance was deleted and should no longer be tracked.
   // The given handle should be one generated by AddInstance.
@@ -89,7 +88,7 @@
   // Returns a pointer to the plugin instance object associated with the given
   // instance handle. The return value will be NULL if the handle is invalid or
   // if the instance has crashed.
-  PluginInstanceImpl* GetInstance(PP_Instance instance);
+  PepperPluginInstanceImpl* GetInstance(PP_Instance instance);
 
  private:
   // PpapiGlobals overrides.
@@ -101,7 +100,7 @@
   HostVarTracker host_var_tracker_;
 
   // Tracks all live instances and their associated object.
-  typedef std::map<PP_Instance, PluginInstanceImpl*> InstanceMap;
+  typedef std::map<PP_Instance, PepperPluginInstanceImpl*> InstanceMap;
   InstanceMap instance_map_;
 
   // Tracks all live modules. The pointers are non-owning, the PluginModule
@@ -112,7 +111,6 @@
   DISALLOW_COPY_AND_ASSIGN(HostGlobals);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif   // CONTENT_RENDERER_PEPPER_HOST_GLOBALS_H_
diff --git a/content/renderer/pepper/host_var_tracker.cc b/content/renderer/pepper/host_var_tracker.cc
index b61af73..9b9ebda 100644
--- a/content/renderer/pepper/host_var_tracker.cc
+++ b/content/renderer/pepper/host_var_tracker.cc
@@ -7,14 +7,13 @@
 #include "base/logging.h"
 #include "content/renderer/pepper/host_array_buffer_var.h"
 #include "content/renderer/pepper/npobject_var.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "ppapi/c/pp_var.h"
 
 using ppapi::ArrayBufferVar;
 using ppapi::NPObjectVar;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 HostVarTracker::HostVarTracker()
   : VarTracker(SINGLE_THREADED),
@@ -169,5 +168,4 @@
   return true;
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/host_var_tracker.h b/content/renderer/pepper/host_var_tracker.h
index 9ff0dbd..290e858 100644
--- a/content/renderer/pepper/host_var_tracker.h
+++ b/content/renderer/pepper/host_var_tracker.h
@@ -27,8 +27,7 @@
 class Var;
 }
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 // Adds NPObject var tracking to the standard PPAPI VarTracker for use in the
 // renderer.
@@ -104,7 +103,6 @@
   DISALLOW_COPY_AND_ASSIGN(HostVarTracker);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_HOST_VAR_TRACKER_H_
diff --git a/content/renderer/pepper/host_var_tracker_unittest.cc b/content/renderer/pepper/host_var_tracker_unittest.cc
index 037f059..a5a1c18 100644
--- a/content/renderer/pepper/host_var_tracker_unittest.cc
+++ b/content/renderer/pepper/host_var_tracker_unittest.cc
@@ -11,7 +11,7 @@
 #include "content/renderer/pepper/mock_resource.h"
 #include "content/renderer/pepper/npapi_glue.h"
 #include "content/renderer/pepper/npobject_var.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "ppapi/c/pp_var.h"
 #include "ppapi/c/ppp_instance.h"
 #include "third_party/npapi/bindings/npruntime.h"
@@ -19,8 +19,7 @@
 
 using ppapi::NPObjectVar;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 
@@ -84,8 +83,9 @@
 
 TEST_F(HostVarTrackerTest, DeleteObjectVarWithInstance) {
   // Make a second instance (the test harness already creates & manages one).
-  scoped_refptr<PluginInstanceImpl> instance2(
-      PluginInstanceImpl::Create(delegate(), NULL, module(), NULL, GURL()));
+  scoped_refptr<PepperPluginInstanceImpl> instance2(
+      PepperPluginInstanceImpl::Create(
+          delegate(), NULL, module(), NULL, GURL()));
   PP_Instance pp_instance2 = instance2->pp_instance();
 
   // Make an object var.
@@ -134,5 +134,4 @@
   var_tracker->ReleaseVar(static_cast<int32_t>(pp_object3.value.as_id));
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/message_channel.cc b/content/renderer/pepper/message_channel.cc
index ea3bdf5..7cd7430 100644
--- a/content/renderer/pepper/message_channel.cc
+++ b/content/renderer/pepper/message_channel.cc
@@ -12,8 +12,8 @@
 #include "base/message_loop/message_loop.h"
 #include "content/renderer/pepper/host_array_buffer_var.h"
 #include "content/renderer/pepper/npapi_glue.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/plugin_module.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "content/renderer/pepper/v8_var_converter.h"
 #include "ppapi/shared_impl/ppapi_globals.h"
 #include "ppapi/shared_impl/var.h"
@@ -38,9 +38,7 @@
 using WebKit::WebPluginContainer;
 using WebKit::WebSerializedScriptValue;
 
-namespace webkit {
-
-namespace ppapi {
+namespace content {
 
 namespace {
 
@@ -328,7 +326,7 @@
 
 MessageChannel::MessageChannelNPObject::~MessageChannelNPObject() {}
 
-MessageChannel::MessageChannel(PluginInstanceImpl* instance)
+MessageChannel::MessageChannel(PepperPluginInstanceImpl* instance)
     : instance_(instance),
       passthrough_object_(NULL),
       np_object_(NULL),
@@ -405,7 +403,7 @@
 
 void MessageChannel::StopQueueingJavaScriptMessages() {
   // We PostTask here instead of draining the message queue directly
-  // since we haven't finished initializing the WebPluginImpl yet, so
+  // since we haven't finished initializing the PepperWebPluginImpl yet, so
   // the plugin isn't available in the DOM.
   early_message_queue_state_ = DRAIN_PENDING;
   base::MessageLoop::current()->PostTask(
@@ -425,7 +423,7 @@
   // Take a reference on the PluginInstance. This is because JavaScript code
   // may delete the plugin, which would destroy the PluginInstance and its
   // corresponding MessageChannel.
-  scoped_refptr<PluginInstanceImpl> instance_ref(instance_);
+  scoped_refptr<PepperPluginInstanceImpl> instance_ref(instance_);
 
   if (early_message_queue_state_ == DRAIN_CANCELLED) {
     early_message_queue_state_ = QUEUE_MESSAGES;
@@ -516,5 +514,4 @@
   passthrough_object_ = passthrough;
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/message_channel.h b/content/renderer/pepper/message_channel.h
index 322c4b4..b377b51 100644
--- a/content/renderer/pepper/message_channel.h
+++ b/content/renderer/pepper/message_channel.h
@@ -14,10 +14,9 @@
 
 struct PP_Var;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
-class PluginInstanceImpl;
+class PepperPluginInstanceImpl;
 
 // MessageChannel implements bidirectional postMessage functionality, allowing
 // calls from JavaScript to plugins and vice-versa. See
@@ -45,7 +44,7 @@
     base::WeakPtr<MessageChannel> message_channel;
   };
 
-  explicit MessageChannel(PluginInstanceImpl* instance);
+  explicit MessageChannel(PepperPluginInstanceImpl* instance);
   ~MessageChannel();
 
   // Post a message to the onmessage handler for this channel's instance
@@ -66,7 +65,7 @@
 
   NPObject* np_object() { return np_object_; }
 
-  PluginInstanceImpl* instance() {
+  PepperPluginInstanceImpl* instance() {
     return instance_;
   }
 
@@ -77,7 +76,7 @@
   void StopQueueingJavaScriptMessages();
 
  private:
-  PluginInstanceImpl* instance_;
+  PepperPluginInstanceImpl* instance_;
 
   // We pass all non-postMessage calls through to the passthrough_object_.
   // This way, a plugin can use PPB_Class or PPP_Class_Deprecated and also
@@ -104,7 +103,7 @@
   base::WeakPtrFactory<MessageChannel> weak_ptr_factory_;
 
   // TODO(teravest): Remove all the tricky DRAIN_CANCELLED logic once
-  // webkit::ppapi::PluginInstance::ResetAsProxied() is gone.
+  // PluginInstance::ResetAsProxied() is gone.
   std::deque<WebKit::WebSerializedScriptValue> early_message_queue_;
   enum EarlyMessageQueueState {
     QUEUE_MESSAGES,       // Queue JS messages.
@@ -117,7 +116,6 @@
   DISALLOW_COPY_AND_ASSIGN(MessageChannel);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_MESSAGE_CHANNEL_H_
diff --git a/content/renderer/pepper/mock_platform_image_2d.cc b/content/renderer/pepper/mock_platform_image_2d.cc
index 2aba190..3a170be 100644
--- a/content/renderer/pepper/mock_platform_image_2d.cc
+++ b/content/renderer/pepper/mock_platform_image_2d.cc
@@ -6,8 +6,7 @@
 
 #include "skia/ext/platform_canvas.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 MockPlatformImage2D::MockPlatformImage2D(int width, int height)
   : width_(width),
@@ -30,5 +29,4 @@
   return NULL;
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/mock_platform_image_2d.h b/content/renderer/pepper/mock_platform_image_2d.h
index eedd4af..19b8202 100644
--- a/content/renderer/pepper/mock_platform_image_2d.h
+++ b/content/renderer/pepper/mock_platform_image_2d.h
@@ -8,8 +8,7 @@
 #include "content/renderer/pepper/plugin_delegate.h"
 #include "skia/ext/platform_canvas.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class MockPlatformImage2D : public PluginDelegate::PlatformImage2D {
  public:
@@ -26,7 +25,6 @@
   int height_;
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_MOCK_PLATFORM_IMAGE_2D_H_
diff --git a/content/renderer/pepper/mock_plugin_delegate.cc b/content/renderer/pepper/mock_plugin_delegate.cc
index aae195e..69bb2d5 100644
--- a/content/renderer/pepper/mock_plugin_delegate.cc
+++ b/content/renderer/pepper/mock_plugin_delegate.cc
@@ -7,16 +7,15 @@
 #include "base/logging.h"
 #include "base/message_loop/message_loop_proxy.h"
 #include "content/renderer/pepper/mock_platform_image_2d.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/plugin_delegate.h"
 #include "content/renderer/pepper/plugin_module.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "ppapi/c/pp_errors.h"
 #include "ppapi/shared_impl/ppapi_permissions.h"
 #include "ppapi/shared_impl/ppapi_preferences.h"
 #include "third_party/WebKit/public/platform/WebGamepads.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 MockPluginDelegate::MockPluginDelegate() {
 }
@@ -24,23 +23,24 @@
 MockPluginDelegate::~MockPluginDelegate() {
 }
 
-void MockPluginDelegate::PluginFocusChanged(PluginInstanceImpl* instance,
+void MockPluginDelegate::PluginFocusChanged(PepperPluginInstanceImpl* instance,
                                             bool focused) {
 }
 
 void MockPluginDelegate::PluginTextInputTypeChanged(
-    PluginInstanceImpl* instance) {
+    PepperPluginInstanceImpl* instance) {
 }
 
 void MockPluginDelegate::PluginCaretPositionChanged(
-    PluginInstanceImpl* instance) {
+    PepperPluginInstanceImpl* instance) {
 }
 
 void MockPluginDelegate::PluginRequestedCancelComposition(
-    PluginInstanceImpl* instance) {
+    PepperPluginInstanceImpl* instance) {
 }
 
-void MockPluginDelegate::PluginSelectionChanged(PluginInstanceImpl* instance) {
+void MockPluginDelegate::PluginSelectionChanged(
+    PepperPluginInstanceImpl* instance) {
 }
 
 void MockPluginDelegate::SimulateImeSetComposition(
@@ -54,17 +54,18 @@
     const base::string16& text) {
 }
 
-void MockPluginDelegate::PluginCrashed(PluginInstanceImpl* instance) {
+void MockPluginDelegate::PluginCrashed(PepperPluginInstanceImpl* instance) {
 }
 
-void MockPluginDelegate::InstanceCreated(PluginInstanceImpl* instance) {
+void MockPluginDelegate::InstanceCreated(PepperPluginInstanceImpl* instance) {
 }
 
-void MockPluginDelegate::InstanceDeleted(PluginInstanceImpl* instance) {
+void MockPluginDelegate::InstanceDeleted(PepperPluginInstanceImpl* instance) {
 }
 
 scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>
-MockPluginDelegate::CreateResourceCreationAPI(PluginInstanceImpl* instance) {
+    MockPluginDelegate::CreateResourceCreationAPI(
+        PepperPluginInstanceImpl* instance) {
   return scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>();
 }
 
@@ -84,7 +85,7 @@
 }
 
 PluginDelegate::PlatformGraphics2D* MockPluginDelegate::GetGraphics2D(
-    PluginInstanceImpl* instance,
+    PepperPluginInstanceImpl* instance,
     PP_Resource graphics_2d) {
   return NULL;
 }
@@ -223,17 +224,6 @@
     const StatusCallback& error_callback) {
 }
 
-void MockPluginDelegate::QueryAvailableSpace(
-    const GURL& origin, quota::StorageType type,
-    const AvailableSpaceCallback& callback) {
-}
-
-void MockPluginDelegate::WillUpdateFile(const GURL& file_path) {
-}
-
-void MockPluginDelegate::DidUpdateFile(const GURL& file_path, int64_t delta) {
-}
-
 void MockPluginDelegate::SyncGetFileSystemPlatformPath(
     const GURL& url,
     base::FilePath* platform_path) {
@@ -321,7 +311,7 @@
 }
 
 FullscreenContainer* MockPluginDelegate::CreateFullscreenContainer(
-    PluginInstanceImpl* instance) {
+    PepperPluginInstanceImpl* instance) {
   return NULL;
 }
 
@@ -346,22 +336,23 @@
   return ::ppapi::Preferences();
 }
 
-bool MockPluginDelegate::LockMouse(PluginInstanceImpl* instance) {
+bool MockPluginDelegate::LockMouse(PepperPluginInstanceImpl* instance) {
   return false;
 }
 
-void MockPluginDelegate::UnlockMouse(PluginInstanceImpl* instance) {
+void MockPluginDelegate::UnlockMouse(PepperPluginInstanceImpl* instance) {
 }
 
-bool MockPluginDelegate::IsMouseLocked(PluginInstanceImpl* instance) {
+bool MockPluginDelegate::IsMouseLocked(PepperPluginInstanceImpl* instance) {
   return false;
 }
 
-void MockPluginDelegate::DidChangeCursor(PluginInstanceImpl* instance,
+void MockPluginDelegate::DidChangeCursor(PepperPluginInstanceImpl* instance,
                                          const WebKit::WebCursorInfo& cursor) {
 }
 
-void MockPluginDelegate::DidReceiveMouseEvent(PluginInstanceImpl* instance) {
+void MockPluginDelegate::DidReceiveMouseEvent(
+    PepperPluginInstanceImpl* instance) {
 }
 
 void MockPluginDelegate::SampleGamepads(WebKit::WebGamepads* data) {
@@ -397,11 +388,11 @@
 }
 
 void MockPluginDelegate::HandleDocumentLoad(
-    PluginInstanceImpl* instance,
+    PepperPluginInstanceImpl* instance,
     const WebKit::WebURLResponse& response) {
 }
 
-content::RendererPpapiHost* MockPluginDelegate::CreateExternalPluginModule(
+RendererPpapiHost* MockPluginDelegate::CreateExternalPluginModule(
     scoped_refptr<PluginModule> module,
     const base::FilePath& path,
     ::ppapi::PpapiPermissions permissions,
@@ -411,5 +402,4 @@
   return NULL;
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/mock_plugin_delegate.h b/content/renderer/pepper/mock_plugin_delegate.h
index 8631dd7..248572a 100644
--- a/content/renderer/pepper/mock_plugin_delegate.h
+++ b/content/renderer/pepper/mock_plugin_delegate.h
@@ -10,23 +10,23 @@
 struct PP_NetAddress_Private;
 namespace ppapi { class PPB_X509Certificate_Fields; }
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class MockPluginDelegate : public PluginDelegate {
  public:
   MockPluginDelegate();
   virtual ~MockPluginDelegate();
 
-  virtual void PluginFocusChanged(PluginInstanceImpl* instance,
+  virtual void PluginFocusChanged(PepperPluginInstanceImpl* instance,
                                   bool focused) OVERRIDE;
   virtual void PluginTextInputTypeChanged(
-      PluginInstanceImpl* instance) OVERRIDE;
+      PepperPluginInstanceImpl* instance) OVERRIDE;
   virtual void PluginCaretPositionChanged(
-      PluginInstanceImpl* instance) OVERRIDE;
+      PepperPluginInstanceImpl* instance) OVERRIDE;
   virtual void PluginRequestedCancelComposition(
-      PluginInstanceImpl* instance) OVERRIDE;
-  virtual void PluginSelectionChanged(PluginInstanceImpl* instance) OVERRIDE;
+      PepperPluginInstanceImpl* instance) OVERRIDE;
+  virtual void PluginSelectionChanged(
+      PepperPluginInstanceImpl* instance) OVERRIDE;
   virtual void SimulateImeSetComposition(
       const base::string16& text,
       const std::vector<WebKit::WebCompositionUnderline>& underlines,
@@ -34,16 +34,16 @@
       int selection_end) OVERRIDE;
   virtual void SimulateImeConfirmComposition(
       const base::string16& text) OVERRIDE;
-  virtual void PluginCrashed(PluginInstanceImpl* instance) OVERRIDE;
-  virtual void InstanceCreated(PluginInstanceImpl* instance) OVERRIDE;
-  virtual void InstanceDeleted(PluginInstanceImpl* instance) OVERRIDE;
+  virtual void PluginCrashed(PepperPluginInstanceImpl* instance) OVERRIDE;
+  virtual void InstanceCreated(PepperPluginInstanceImpl* instance) OVERRIDE;
+  virtual void InstanceDeleted(PepperPluginInstanceImpl* instance) OVERRIDE;
   virtual scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>
-      CreateResourceCreationAPI(PluginInstanceImpl* instance) OVERRIDE;
+      CreateResourceCreationAPI(PepperPluginInstanceImpl* instance) OVERRIDE;
   virtual SkBitmap* GetSadPluginBitmap() OVERRIDE;
   virtual WebKit::WebPlugin* CreatePluginReplacement(
       const base::FilePath& file_path) OVERRIDE;
   virtual PlatformImage2D* CreateImage2D(int width, int height) OVERRIDE;
-  virtual PlatformGraphics2D* GetGraphics2D(PluginInstanceImpl* instance,
+  virtual PlatformGraphics2D* GetGraphics2D(PepperPluginInstanceImpl* instance,
                                             PP_Resource graphics_2d) OVERRIDE;
   virtual PlatformContext3D* CreateContext3D() OVERRIDE;
   virtual PlatformVideoDecoder* CreateVideoDecoder(
@@ -111,12 +111,6 @@
       const GURL& directory_path,
       const ReadDirectoryCallback& success_callback,
       const StatusCallback& error_callback) OVERRIDE;
-  virtual void QueryAvailableSpace(
-      const GURL& origin,
-      quota::StorageType type,
-      const AvailableSpaceCallback& callback) OVERRIDE;
-  virtual void WillUpdateFile(const GURL& file_path) OVERRIDE;
-  virtual void DidUpdateFile(const GURL& file_path, int64_t delta) OVERRIDE;
   virtual void SyncGetFileSystemPlatformPath(
       const GURL& url,
       base::FilePath* platform_path) OVERRIDE;
@@ -162,19 +156,20 @@
       const std::vector<char>& der,
       ::ppapi::PPB_X509Certificate_Fields* fields) OVERRIDE;
   virtual FullscreenContainer* CreateFullscreenContainer(
-      PluginInstanceImpl* instance) OVERRIDE;
+      PepperPluginInstanceImpl* instance) OVERRIDE;
   virtual gfx::Size GetScreenSize() OVERRIDE;
   virtual std::string GetDefaultEncoding() OVERRIDE;
   virtual void ZoomLimitsChanged(double minimum_factor,
                                  double maximum_factor) OVERRIDE;
   virtual base::SharedMemory* CreateAnonymousSharedMemory(size_t size) OVERRIDE;
   virtual ::ppapi::Preferences GetPreferences() OVERRIDE;
-  virtual bool LockMouse(PluginInstanceImpl* instance) OVERRIDE;
-  virtual void UnlockMouse(PluginInstanceImpl* instance) OVERRIDE;
-  virtual bool IsMouseLocked(PluginInstanceImpl* instance) OVERRIDE;
-  virtual void DidChangeCursor(PluginInstanceImpl* instance,
+  virtual bool LockMouse(PepperPluginInstanceImpl* instance) OVERRIDE;
+  virtual void UnlockMouse(PepperPluginInstanceImpl* instance) OVERRIDE;
+  virtual bool IsMouseLocked(PepperPluginInstanceImpl* instance) OVERRIDE;
+  virtual void DidChangeCursor(PepperPluginInstanceImpl* instance,
                                const WebKit::WebCursorInfo& cursor) OVERRIDE;
-  virtual void DidReceiveMouseEvent(PluginInstanceImpl* instance) OVERRIDE;
+  virtual void DidReceiveMouseEvent(
+      PepperPluginInstanceImpl* instance) OVERRIDE;
   virtual void SampleGamepads(WebKit::WebGamepads* data) OVERRIDE;
   virtual bool IsInFullscreenMode() OVERRIDE;
   virtual bool IsPageVisible() const OVERRIDE;
@@ -188,9 +183,9 @@
       bool should_close_source) const OVERRIDE;
   virtual bool IsRunningInProcess(PP_Instance instance) const OVERRIDE;
   virtual void HandleDocumentLoad(
-      PluginInstanceImpl* instance,
+      PepperPluginInstanceImpl* instance,
       const WebKit::WebURLResponse& response) OVERRIDE;
-  virtual content::RendererPpapiHost* CreateExternalPluginModule(
+  virtual RendererPpapiHost* CreateExternalPluginModule(
       scoped_refptr<PluginModule> module,
       const base::FilePath& path,
       ::ppapi::PpapiPermissions permissions,
@@ -199,7 +194,6 @@
       int plugin_child_id) OVERRIDE;
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_MOCK_PLUGIN_DELEGATE_H_
diff --git a/content/renderer/pepper/mock_renderer_ppapi_host.cc b/content/renderer/pepper/mock_renderer_ppapi_host.cc
index 5a2da54..e1de551 100644
--- a/content/renderer/pepper/mock_renderer_ppapi_host.cc
+++ b/content/renderer/pepper/mock_renderer_ppapi_host.cc
@@ -28,7 +28,7 @@
   return instance == pp_instance_;
 }
 
-webkit::ppapi::PluginInstance* MockRendererPpapiHost::GetPluginInstance(
+PepperPluginInstance* MockRendererPpapiHost::GetPluginInstance(
     PP_Instance instance) const {
   NOTIMPLEMENTED();
   return NULL;
diff --git a/content/renderer/pepper/mock_renderer_ppapi_host.h b/content/renderer/pepper/mock_renderer_ppapi_host.h
index 3194d3f..7a18ad2 100644
--- a/content/renderer/pepper/mock_renderer_ppapi_host.h
+++ b/content/renderer/pepper/mock_renderer_ppapi_host.h
@@ -11,14 +11,8 @@
 #include "ppapi/host/ppapi_host.h"
 #include "ppapi/proxy/resource_message_test_sink.h"
 
-namespace webkit {
-namespace ppapi {
-class PluginInstance;
-class PluginModule;
-}
-}
-
 namespace content {
+class PluginModule;
 
 // A mock RendererPpapiHost for testing resource hosts. Messages sent by
 // resources through this will get added to the test sink.
@@ -39,7 +33,7 @@
   // RendererPpapiHost.
   virtual ppapi::host::PpapiHost* GetPpapiHost() OVERRIDE;
   virtual bool IsValidInstance(PP_Instance instance) const OVERRIDE;
-  virtual webkit::ppapi::PluginInstance* GetPluginInstance(
+  virtual PepperPluginInstance* GetPluginInstance(
       PP_Instance instance) const OVERRIDE;
   virtual RenderView* GetRenderViewForInstance(
       PP_Instance instance) const OVERRIDE;
diff --git a/content/renderer/pepper/mock_resource.h b/content/renderer/pepper/mock_resource.h
index 60531f0..fc6d0a8 100644
--- a/content/renderer/pepper/mock_resource.h
+++ b/content/renderer/pepper/mock_resource.h
@@ -7,8 +7,7 @@
 
 #include "ppapi/shared_impl/resource.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 // Tests can derive from this to implement special test-specific resources.
 // It's assumed that a test will only need one mock resource, so it can
@@ -22,7 +21,6 @@
   virtual ~MockResource() {}
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_MOCK_RESOURCE_H_
diff --git a/content/renderer/pepper/npapi_glue.cc b/content/renderer/pepper/npapi_glue.cc
index f8b0c52..96e0bb0 100644
--- a/content/renderer/pepper/npapi_glue.cc
+++ b/content/renderer/pepper/npapi_glue.cc
@@ -11,9 +11,9 @@
 #include "content/renderer/pepper/host_globals.h"
 #include "content/renderer/pepper/host_var_tracker.h"
 #include "content/renderer/pepper/npobject_var.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/plugin_module.h"
 #include "content/renderer/pepper/plugin_object.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "ppapi/c/pp_var.h"
 #include "third_party/npapi/bindings/npapi.h"
 #include "third_party/npapi/bindings/npruntime.h"
@@ -32,14 +32,13 @@
 using WebKit::WebBindings;
 using WebKit::WebPluginContainer;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 
 const char kInvalidPluginValue[] = "Error: Plugin returned invalid value.";
 
-PP_Var NPObjectToPPVarImpl(PluginInstanceImpl* instance,
+PP_Var NPObjectToPPVarImpl(PepperPluginInstanceImpl* instance,
                            NPObject* object,
                            v8::Local<v8::Context> context) {
   DCHECK(object);
@@ -122,7 +121,7 @@
   return true;
 }
 
-PP_Var NPVariantToPPVar(PluginInstanceImpl* instance,
+PP_Var NPVariantToPPVar(PepperPluginInstanceImpl* instance,
                         const NPVariant* variant) {
   switch (variant->type) {
     case NPVariantType_Void:
@@ -172,7 +171,7 @@
   return PP_MakeInt32(int_value);
 }
 
-PP_Var NPObjectToPPVar(PluginInstanceImpl* instance, NPObject* object) {
+PP_Var NPObjectToPPVar(PepperPluginInstanceImpl* instance, NPObject* object) {
   WebPluginContainer* container = instance->container();
   // It's possible that container() is NULL if the plugin has been removed from
   // the DOM (but the PluginInstance is not destroyed yet).
@@ -184,7 +183,8 @@
   return NPObjectToPPVarImpl(instance, object, context);
 }
 
-PP_Var NPObjectToPPVarForTest(PluginInstanceImpl* instance, NPObject* object) {
+PP_Var NPObjectToPPVarForTest(PepperPluginInstanceImpl* instance,
+                              NPObject* object) {
   v8::Isolate* test_isolate = v8::Isolate::New();
   PP_Var result = PP_MakeUndefined();
   {
@@ -280,7 +280,7 @@
 // PPVarArrayFromNPVariantArray ------------------------------------------------
 
 PPVarArrayFromNPVariantArray::PPVarArrayFromNPVariantArray(
-    PluginInstanceImpl* instance,
+    PepperPluginInstanceImpl* instance,
     size_t size,
     const NPVariant* variants)
     : size_(size) {
@@ -299,7 +299,7 @@
 
 // PPVarFromNPObject -----------------------------------------------------------
 
-PPVarFromNPObject::PPVarFromNPObject(PluginInstanceImpl* instance,
+PPVarFromNPObject::PPVarFromNPObject(PepperPluginInstanceImpl* instance,
                                      NPObject* object)
     : var_(NPObjectToPPVar(instance, object)) {
 }
@@ -353,5 +353,4 @@
   static_cast<TryCatch*>(self)->SetException(message);
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/npapi_glue.h b/content/renderer/pepper/npapi_glue.h
index 5cc745b..c2d23c8 100644
--- a/content/renderer/pepper/npapi_glue.h
+++ b/content/renderer/pepper/npapi_glue.h
@@ -15,10 +15,9 @@
 typedef struct _NPVariant NPVariant;
 typedef void* NPIdentifier;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
-class PluginInstanceImpl;
+class PepperPluginInstanceImpl;
 class PluginObject;
 
 // Utilities -------------------------------------------------------------------
@@ -38,7 +37,8 @@
 //
 // The returned PP_Var will have a refcount of 1, this passing ownership of
 // the reference to the caller. This is suitable for returning to a plugin.
-PP_Var NPVariantToPPVar(PluginInstanceImpl* instance, const NPVariant* variant);
+PP_Var NPVariantToPPVar(PepperPluginInstanceImpl* instance,
+                        const NPVariant* variant);
 
 // Returns a NPIdentifier that corresponds to the given PP_Var. The contents
 // of the PP_Var will be copied. Returns 0 if the given PP_Var is not a a
@@ -64,13 +64,13 @@
 // Note: this could easily be changed to take a PP_Instance instead if that
 // makes certain calls in the future easier. Currently all callers have a
 // PluginInstance so that's what we use here.
-CONTENT_EXPORT PP_Var NPObjectToPPVar(PluginInstanceImpl* instance,
+CONTENT_EXPORT PP_Var NPObjectToPPVar(PepperPluginInstanceImpl* instance,
                                       NPObject* object);
 
 // This version creates a default v8::Context rather than using the one from
 // the container of |instance|. It is only for use in unit tests, where we don't
 // have a real container for |instance|.
-CONTENT_EXPORT PP_Var NPObjectToPPVarForTest(PluginInstanceImpl* instance,
+CONTENT_EXPORT PP_Var NPObjectToPPVarForTest(PepperPluginInstanceImpl* instance,
                                              NPObject* object);
 
 // PPResultAndExceptionToNPResult ----------------------------------------------
@@ -152,7 +152,7 @@
 // WebKit to the plugin.
 class PPVarArrayFromNPVariantArray {
  public:
-  PPVarArrayFromNPVariantArray(PluginInstanceImpl* instance,
+  PPVarArrayFromNPVariantArray(PepperPluginInstanceImpl* instance,
                                size_t size,
                                const NPVariant* variants);
   ~PPVarArrayFromNPVariantArray();
@@ -172,7 +172,7 @@
 // is used when converting 'this' pointer from WebKit to the plugin.
 class PPVarFromNPObject {
  public:
-  PPVarFromNPObject(PluginInstanceImpl* instance, NPObject* object);
+  PPVarFromNPObject(PepperPluginInstanceImpl* instance, NPObject* object);
   ~PPVarFromNPObject();
 
   PP_Var var() const { return var_; }
@@ -259,7 +259,6 @@
   PP_Var* exception_;
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_NPAPI_GLUE_H_
diff --git a/content/renderer/pepper/npobject_var.cc b/content/renderer/pepper/npobject_var.cc
index 0ab1755..690dd22 100644
--- a/content/renderer/pepper/npobject_var.cc
+++ b/content/renderer/pepper/npobject_var.cc
@@ -10,7 +10,6 @@
 #include "ppapi/c/pp_var.h"
 #include "third_party/WebKit/public/web/WebBindings.h"
 
-using webkit::ppapi::HostGlobals;
 using WebKit::WebBindings;
 
 namespace ppapi {
@@ -22,12 +21,12 @@
     : pp_instance_(instance),
       np_object_(np_object) {
   WebBindings::retainObject(np_object_);
-  HostGlobals::Get()->host_var_tracker()->AddNPObjectVar(this);
+  content::HostGlobals::Get()->host_var_tracker()->AddNPObjectVar(this);
 }
 
 NPObjectVar::~NPObjectVar() {
   if (pp_instance())
-    HostGlobals::Get()->host_var_tracker()->RemoveNPObjectVar(this);
+    content::HostGlobals::Get()->host_var_tracker()->RemoveNPObjectVar(this);
   WebBindings::releaseObject(np_object_);
 }
 
@@ -41,7 +40,7 @@
 
 void NPObjectVar::InstanceDeleted() {
   DCHECK(pp_instance_);
-  HostGlobals::Get()->host_var_tracker()->RemoveNPObjectVar(this);
+  content::HostGlobals::Get()->host_var_tracker()->RemoveNPObjectVar(this);
   pp_instance_ = 0;
 }
 
diff --git a/content/renderer/pepper/npobject_var.h b/content/renderer/pepper/npobject_var.h
index 6cafbb4..68f9097 100644
--- a/content/renderer/pepper/npobject_var.h
+++ b/content/renderer/pepper/npobject_var.h
@@ -66,6 +66,6 @@
   DISALLOW_COPY_AND_ASSIGN(NPObjectVar);
 };
 
-}  // namespace
+}  // ppapi
 
 #endif  // CONTENT_RENDERER_PEPPER_NPOBJECT_VAR_H_
diff --git a/content/renderer/pepper/pepper_audio_input_host.cc b/content/renderer/pepper/pepper_audio_input_host.cc
index 6e74126..a4056d2 100644
--- a/content/renderer/pepper/pepper_audio_input_host.cc
+++ b/content/renderer/pepper/pepper_audio_input_host.cc
@@ -6,7 +6,7 @@
 
 #include "base/logging.h"
 #include "build/build_config.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/renderer_ppapi_host_impl.h"
 #include "ipc/ipc_message.h"
 #include "media/audio/shared_memory_util.h"
@@ -83,8 +83,8 @@
                  base::SyncSocket::kInvalidHandle);
 }
 
-webkit::ppapi::PluginDelegate* PepperAudioInputHost::GetPluginDelegate() {
-  webkit::ppapi::PluginInstanceImpl* instance =
+PluginDelegate* PepperAudioInputHost::GetPluginDelegate() {
+  PepperPluginInstanceImpl* instance =
       renderer_ppapi_host_->GetPluginInstanceImpl(pp_instance());
   if (instance)
     return instance->delegate();
@@ -101,11 +101,11 @@
   if (audio_input_)
     return PP_ERROR_FAILED;
 
-  webkit::ppapi::PluginDelegate* plugin_delegate = GetPluginDelegate();
+  PluginDelegate* plugin_delegate = GetPluginDelegate();
   if (!plugin_delegate)
     return PP_ERROR_FAILED;
 
-  webkit::ppapi::PluginInstanceImpl* instance =
+  PepperPluginInstanceImpl* instance =
       renderer_ppapi_host_->GetPluginInstanceImpl(pp_instance());
   if (!instance)
     return PP_ERROR_FAILED;
diff --git a/content/renderer/pepper/pepper_audio_input_host.h b/content/renderer/pepper/pepper_audio_input_host.h
index 8316ec8..f142197 100644
--- a/content/renderer/pepper/pepper_audio_input_host.h
+++ b/content/renderer/pepper/pepper_audio_input_host.h
@@ -25,7 +25,7 @@
 
 class PepperAudioInputHost
     : public ppapi::host::ResourceHost,
-      public webkit::ppapi::PluginDelegate::PlatformAudioInputClient,
+      public PluginDelegate::PlatformAudioInputClient,
       public PepperDeviceEnumerationHostHelper::Delegate {
  public:
   PepperAudioInputHost(RendererPpapiHostImpl* host,
@@ -44,7 +44,7 @@
   virtual void StreamCreationFailed() OVERRIDE;
 
   // PepperDeviceEnumerationHostHelper::Delegate implementation.
-  virtual webkit::ppapi::PluginDelegate* GetPluginDelegate() OVERRIDE;
+  virtual PluginDelegate* GetPluginDelegate() OVERRIDE;
 
  private:
   int32_t OnOpen(ppapi::host::HostMessageContext* context,
@@ -75,7 +75,7 @@
 
   // PluginDelegate audio input object that we delegate audio IPC through.
   // We don't own this pointer but are responsible for calling Shutdown on it.
-  webkit::ppapi::PluginDelegate::PlatformAudioInput* audio_input_;
+  PluginDelegate::PlatformAudioInput* audio_input_;
 
   PepperDeviceEnumerationHostHelper enumeration_helper_;
 
diff --git a/content/renderer/pepper/pepper_broker_impl.cc b/content/renderer/pepper/pepper_broker_impl.cc
index aca9f32..a245885 100644
--- a/content/renderer/pepper/pepper_broker_impl.cc
+++ b/content/renderer/pepper/pepper_broker_impl.cc
@@ -79,7 +79,7 @@
     return false;
   }
   dispatcher_->channel()->SetRestrictDispatchChannelGroup(
-      content::kRendererRestrictDispatchGroup_Pepper);
+      kRendererRestrictDispatchGroup_Pepper);
   return true;
 }
 
@@ -107,7 +107,7 @@
   return result;
 }
 
-PepperBrokerImpl::PepperBrokerImpl(webkit::ppapi::PluginModule* plugin_module,
+PepperBrokerImpl::PepperBrokerImpl(PluginModule* plugin_module,
                                    PepperPluginDelegateImpl* delegate)
     : plugin_module_(plugin_module),
       delegate_(delegate->AsWeakPtr()) {
@@ -124,8 +124,7 @@
 }
 
 // If the channel is not ready, queue the connection.
-void PepperBrokerImpl::AddPendingConnect(
-    webkit::ppapi::PPB_Broker_Impl* client) {
+void PepperBrokerImpl::AddPendingConnect(PPB_Broker_Impl* client) {
   DCHECK(pending_connects_.find(client) == pending_connects_.end())
       << "Connect was already called for this client";
 
@@ -141,7 +140,7 @@
   pending_connects_[client].client = client->AsWeakPtr();
 }
 
-void PepperBrokerImpl::Disconnect(webkit::ppapi::PPB_Broker_Impl* client) {
+void PepperBrokerImpl::Disconnect(PPB_Broker_Impl* client) {
   // Remove the pending connect if one exists. This class will not call client's
   // callback.
   pending_connects_.erase(client);
@@ -190,8 +189,7 @@
   // Process all pending channel requests from the plugins.
   for (ClientMap::iterator i = pending_connects_.begin();
        i != pending_connects_.end();) {
-    base::WeakPtr<webkit::ppapi::PPB_Broker_Impl>& weak_ptr =
-        i->second.client;
+    base::WeakPtr<PPB_Broker_Impl>& weak_ptr = i->second.client;
     if (!i->second.is_authorized) {
       ++i;
       continue;
@@ -204,9 +202,8 @@
   }
 }
 
-void PepperBrokerImpl::OnBrokerPermissionResult(
-    webkit::ppapi::PPB_Broker_Impl* client,
-    bool result) {
+void PepperBrokerImpl::OnBrokerPermissionResult(PPB_Broker_Impl* client,
+                                                bool result) {
   ClientMap::iterator entry = pending_connects_.find(client);
   if (entry == pending_connects_.end())
     return;
@@ -249,8 +246,7 @@
   DCHECK_NE(PP_OK, error_code);
   for (ClientMap::iterator i = pending_connects_.begin();
        i != pending_connects_.end(); ++i) {
-    base::WeakPtr<webkit::ppapi::PPB_Broker_Impl>& weak_ptr =
-        i->second.client;
+    base::WeakPtr<PPB_Broker_Impl>& weak_ptr = i->second.client;
     if (weak_ptr.get()) {
       weak_ptr->BrokerConnected(
           ppapi::PlatformFileToInt(base::kInvalidPlatformFileValue),
@@ -260,8 +256,7 @@
   pending_connects_.clear();
 }
 
-void PepperBrokerImpl::ConnectPluginToBroker(
-    webkit::ppapi::PPB_Broker_Impl* client) {
+void PepperBrokerImpl::ConnectPluginToBroker(PPB_Broker_Impl* client) {
   base::SyncSocket::Handle plugin_handle = base::kInvalidPlatformFileValue;
   int32_t result = PP_OK;
 
diff --git a/content/renderer/pepper/pepper_broker_impl.h b/content/renderer/pepper/pepper_broker_impl.h
index ce81d96..a9c1411 100644
--- a/content/renderer/pepper/pepper_broker_impl.h
+++ b/content/renderer/pepper/pepper_broker_impl.h
@@ -22,15 +22,10 @@
 }
 }
 
-namespace webkit {
-namespace ppapi {
-class PluginModule;
-}
-}
-
 namespace content {
 
 class PepperPluginDelegateImpl;
+class PluginModule;
 
 // This object is NOT thread-safe.
 class CONTENT_EXPORT PepperBrokerDispatcherWrapper {
@@ -49,17 +44,17 @@
   scoped_ptr<ppapi::proxy::ProxyChannel::Delegate> dispatcher_delegate_;
 };
 
-class PepperBrokerImpl : public webkit::ppapi::PluginDelegate::Broker,
+class PepperBrokerImpl : public PluginDelegate::Broker,
                          public base::RefCountedThreadSafe<PepperBrokerImpl>{
  public:
-  PepperBrokerImpl(webkit::ppapi::PluginModule* plugin_module,
+  PepperBrokerImpl(PluginModule* plugin_module,
                    PepperPluginDelegateImpl* delegate_);
 
-  // webkit::ppapi::PluginDelegate::Broker implementation.
-  virtual void Disconnect(webkit::ppapi::PPB_Broker_Impl* client) OVERRIDE;
+  // PluginDelegate::Broker implementation.
+  virtual void Disconnect(PPB_Broker_Impl* client) OVERRIDE;
 
   // Adds a pending connection to the broker. Balances out Disconnect() calls.
-  void AddPendingConnect(webkit::ppapi::PPB_Broker_Impl* client);
+  void AddPendingConnect(PPB_Broker_Impl* client);
 
   // Called when the channel to the broker has been established.
   void OnBrokerChannelConnected(base::ProcessId broker_pid,
@@ -67,7 +62,7 @@
 
   // Called when we know whether permission to access the PPAPI broker was
   // granted.
-  void OnBrokerPermissionResult(webkit::ppapi::PPB_Broker_Impl* client,
+  void OnBrokerPermissionResult(PPB_Broker_Impl* client,
                                 bool result);
 
  private:
@@ -78,7 +73,7 @@
     ~PendingConnection();
 
     bool is_authorized;
-    base::WeakPtr<webkit::ppapi::PPB_Broker_Impl> client;
+    base::WeakPtr<PPB_Broker_Impl> client;
   };
 
   virtual ~PepperBrokerImpl();
@@ -87,20 +82,19 @@
   void ReportFailureToClients(int error_code);
 
   // Connects the plugin to the broker via a pipe.
-  void ConnectPluginToBroker(webkit::ppapi::PPB_Broker_Impl* client);
+  void ConnectPluginToBroker(PPB_Broker_Impl* client);
 
   scoped_ptr<PepperBrokerDispatcherWrapper> dispatcher_;
 
   // A map of pointers to objects that have requested a connection to the weak
   // pointer we can use to reference them. The mapping is needed so we can clean
   // up entries for objects that may have been deleted.
-  typedef std::map<webkit::ppapi::PPB_Broker_Impl*, PendingConnection>
-      ClientMap;
+  typedef std::map<PPB_Broker_Impl*, PendingConnection> ClientMap;
   ClientMap pending_connects_;
 
   // Pointer to the associated plugin module.
   // Always set and cleared at the same time as the module's pointer to this.
-  webkit::ppapi::PluginModule* plugin_module_;
+  PluginModule* plugin_module_;
 
   base::WeakPtr<PepperPluginDelegateImpl> delegate_;
 
diff --git a/content/renderer/pepper/pepper_device_enumeration_event_handler.cc b/content/renderer/pepper/pepper_device_enumeration_event_handler.cc
index 7f662a1..8828fee 100644
--- a/content/renderer/pepper/pepper_device_enumeration_event_handler.cc
+++ b/content/renderer/pepper/pepper_device_enumeration_event_handler.cc
@@ -32,7 +32,7 @@
 }
 
 int PepperDeviceEnumerationEventHandler::RegisterEnumerateDevicesCallback(
-    const webkit::ppapi::PluginDelegate::EnumerateDevicesCallback& callback) {
+    const PluginDelegate::EnumerateDevicesCallback& callback) {
   enumerate_callbacks_[next_id_] = callback;
   return next_id_++;
 }
@@ -129,8 +129,7 @@
     return;
   }
 
-  webkit::ppapi::PluginDelegate::EnumerateDevicesCallback callback =
-      iter->second;
+  PluginDelegate::EnumerateDevicesCallback callback = iter->second;
 
   std::vector<ppapi::DeviceRefData> devices;
   if (succeeded) {
diff --git a/content/renderer/pepper/pepper_device_enumeration_event_handler.h b/content/renderer/pepper/pepper_device_enumeration_event_handler.h
index 543bcdb..05835ed 100644
--- a/content/renderer/pepper/pepper_device_enumeration_event_handler.h
+++ b/content/renderer/pepper/pepper_device_enumeration_event_handler.h
@@ -22,7 +22,7 @@
   virtual ~PepperDeviceEnumerationEventHandler();
 
   int RegisterEnumerateDevicesCallback(
-      const webkit::ppapi::PluginDelegate::EnumerateDevicesCallback& callback);
+      const PluginDelegate::EnumerateDevicesCallback& callback);
   void UnregisterEnumerateDevicesCallback(int request_id);
 
   int RegisterOpenDeviceCallback(
@@ -62,8 +62,7 @@
 
   int next_id_;
 
-  typedef std::map<int,
-                   webkit::ppapi::PluginDelegate::EnumerateDevicesCallback>
+  typedef std::map<int, PluginDelegate::EnumerateDevicesCallback>
       EnumerateCallbackMap;
   EnumerateCallbackMap enumerate_callbacks_;
 
diff --git a/content/renderer/pepper/pepper_device_enumeration_host_helper.cc b/content/renderer/pepper/pepper_device_enumeration_host_helper.cc
index 136c946..ba281ea 100644
--- a/content/renderer/pepper/pepper_device_enumeration_host_helper.cc
+++ b/content/renderer/pepper/pepper_device_enumeration_host_helper.cc
@@ -19,7 +19,6 @@
 #include "ppapi/shared_impl/ppb_device_ref_shared.h"
 
 using ppapi::host::HostMessageContext;
-using webkit::ppapi::PluginDelegate;
 
 namespace content {
 
diff --git a/content/renderer/pepper/pepper_device_enumeration_host_helper.h b/content/renderer/pepper/pepper_device_enumeration_host_helper.h
index 0781f58..d7e92c7 100644
--- a/content/renderer/pepper/pepper_device_enumeration_host_helper.h
+++ b/content/renderer/pepper/pepper_device_enumeration_host_helper.h
@@ -26,13 +26,8 @@
 class Message;
 }
 
-namespace webkit {
-namespace ppapi {
-class PluginDelegate;
-}
-}
-
 namespace content {
+class PluginDelegate;
 
 // Resource hosts that support device enumeration can use this class to filter
 // and process PpapiHostMsg_DeviceEnumeration_* messages.
@@ -47,7 +42,7 @@
 
     // TODO(yzshen): Move the relevant functionality out of PluginDelegate and
     // get rid of this method.
-    virtual webkit::ppapi::PluginDelegate* GetPluginDelegate() = 0;
+    virtual PluginDelegate* GetPluginDelegate() = 0;
   };
 
   // |resource_host| and |delegate| must outlive this object.
diff --git a/content/renderer/pepper/pepper_device_enumeration_host_helper_unittest.cc b/content/renderer/pepper/pepper_device_enumeration_host_helper_unittest.cc
index f4e5714..a6ff34b 100644
--- a/content/renderer/pepper/pepper_device_enumeration_host_helper_unittest.cc
+++ b/content/renderer/pepper/pepper_device_enumeration_host_helper_unittest.cc
@@ -24,7 +24,7 @@
 
 namespace {
 
-class TestPluginDelegate : public webkit::ppapi::MockPluginDelegate {
+class TestPluginDelegate : public MockPluginDelegate {
  public:
   TestPluginDelegate() : last_used_id_(0) {
   }
@@ -79,19 +79,19 @@
   TestResourceHost(ppapi::host::PpapiHost* host,
                    PP_Instance instance,
                    PP_Resource resource,
-                   webkit::ppapi::PluginDelegate* delegate)
+                   PluginDelegate* delegate)
       : ResourceHost(host, instance, resource),
         delegate_(delegate) {
   }
 
   virtual ~TestResourceHost() {}
 
-  virtual webkit::ppapi::PluginDelegate* GetPluginDelegate() OVERRIDE {
+  virtual PluginDelegate* GetPluginDelegate() OVERRIDE {
     return delegate_;
   }
 
  private:
-  webkit::ppapi::PluginDelegate* delegate_;
+  PluginDelegate* delegate_;
 
   DISALLOW_COPY_AND_ASSIGN(TestResourceHost);
 };
diff --git a/content/renderer/pepper/pepper_file_chooser_host.cc b/content/renderer/pepper/pepper_file_chooser_host.cc
index 8eecb07..1229d17 100644
--- a/content/renderer/pepper/pepper_file_chooser_host.cc
+++ b/content/renderer/pepper/pepper_file_chooser_host.cc
@@ -106,8 +106,7 @@
     base::FilePath file_path(files[i].path);
 #endif
 
-    webkit::ppapi::PPB_FileRef_Impl* ref =
-        webkit::ppapi::PPB_FileRef_Impl::CreateExternal(
+    PPB_FileRef_Impl* ref = PPB_FileRef_Impl::CreateExternal(
         pp_instance(), file_path, files[i].display_name);
     ppapi::PPB_FileRef_CreateInfo create_info;
     ppapi::proxy::PPB_FileRef_Proxy::SerializeFileRef(ref->GetReference(),
diff --git a/content/renderer/pepper/pepper_file_io_host.cc b/content/renderer/pepper/pepper_file_io_host.cc
index 96f0e82..74b4c3d 100644
--- a/content/renderer/pepper/pepper_file_io_host.cc
+++ b/content/renderer/pepper/pepper_file_io_host.cc
@@ -9,12 +9,16 @@
 #include "base/callback_helpers.h"
 #include "base/command_line.h"
 #include "base/files/file_util_proxy.h"
+#include "content/child/child_thread.h"
+#include "content/child/quota_dispatcher.h"
+#include "content/common/fileapi/file_system_messages.h"
 #include "content/public/common/content_client.h"
 #include "content/public/renderer/content_renderer_client.h"
 #include "content/renderer/pepper/host_globals.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/ppb_file_ref_impl.h"
 #include "content/renderer/pepper/quota_file_io.h"
+#include "content/renderer/render_thread_impl.h"
 #include "ppapi/c/pp_errors.h"
 #include "ppapi/host/dispatch_host_message.h"
 #include "ppapi/host/ppapi_host.h"
@@ -31,8 +35,6 @@
 using ppapi::host::ReplyMessageContext;
 using ppapi::thunk::EnterResourceNoLock;
 using ppapi::thunk::PPB_FileRef_API;
-using webkit::ppapi::PPB_FileRef_Impl;
-using webkit::ppapi::PluginDelegate;
 
 namespace {
 
@@ -52,6 +54,48 @@
   return pp_error == PP_OK ? byte_number : pp_error;
 }
 
+class QuotaCallbackTranslator : public QuotaDispatcher::Callback {
+ public:
+  typedef QuotaFileIO::Delegate::AvailableSpaceCallback PluginCallback;
+  explicit QuotaCallbackTranslator(const PluginCallback& cb) : callback_(cb) {}
+  virtual void DidQueryStorageUsageAndQuota(int64 usage, int64 quota) OVERRIDE {
+    callback_.Run(std::max(static_cast<int64>(0), quota - usage));
+  }
+  virtual void DidGrantStorageQuota(int64 granted_quota) OVERRIDE {
+    NOTREACHED();
+  }
+  virtual void DidFail(quota::QuotaStatusCode error) OVERRIDE {
+    callback_.Run(0);
+  }
+ private:
+  PluginCallback callback_;
+};
+
+class QuotaFileIODelegate : public QuotaFileIO::Delegate {
+ public:
+  QuotaFileIODelegate() {}
+  virtual ~QuotaFileIODelegate() {}
+
+  virtual void QueryAvailableSpace(
+      const GURL& origin,
+      quota::StorageType type,
+      const AvailableSpaceCallback& callback) OVERRIDE {
+    ChildThread::current()->quota_dispatcher()->QueryStorageUsageAndQuota(
+        origin, type, new QuotaCallbackTranslator(callback));
+  }
+  virtual void WillUpdateFile(const GURL& file_path) OVERRIDE {
+    ChildThread::current()->Send(new FileSystemHostMsg_WillUpdate(file_path));
+  }
+  virtual void DidUpdateFile(const GURL& file_path, int64_t delta) OVERRIDE {
+    ChildThread::current()->Send(new FileSystemHostMsg_DidUpdate(
+        file_path, delta));
+  }
+  virtual scoped_refptr<base::MessageLoopProxy>
+      GetFileThreadMessageLoopProxy() OVERRIDE {
+    return RenderThreadImpl::current()->GetFileThreadMessageLoopProxy();
+  }
+};
+
 }  // namespace
 
 PepperFileIOHost::PepperFileIOHost(RendererPpapiHost* host,
@@ -66,8 +110,8 @@
       open_flags_(0),
       weak_factory_(this) {
   // TODO(victorhsieh): eliminate plugin_delegate_ as it's no longer needed.
-  webkit::ppapi::PluginInstanceImpl* plugin_instance =
-      webkit::ppapi::HostGlobals::Get()->GetInstance(instance);
+  PepperPluginInstanceImpl* plugin_instance =
+      HostGlobals::Get()->GetInstance(instance);
   plugin_delegate_ = plugin_instance ? plugin_instance->delegate() : NULL;
 }
 
@@ -480,8 +524,8 @@
   if (file_ != base::kInvalidPlatformFileValue &&
       (file_system_type_ == PP_FILESYSTEMTYPE_LOCALTEMPORARY ||
        file_system_type_ == PP_FILESYSTEMTYPE_LOCALPERSISTENT)) {
-    quota_file_io_.reset(new webkit::ppapi::QuotaFileIO(
-        pp_instance(), file_, file_system_url_, file_system_type_));
+    quota_file_io_.reset(new QuotaFileIO(
+        new QuotaFileIODelegate, file_, file_system_url_, file_system_type_));
   }
 
   reply_context.params.set_result(pp_error);
diff --git a/content/renderer/pepper/pepper_file_io_host.h b/content/renderer/pepper/pepper_file_io_host.h
index 89e70f7..7efc0af 100644
--- a/content/renderer/pepper/pepper_file_io_host.h
+++ b/content/renderer/pepper/pepper_file_io_host.h
@@ -18,15 +18,9 @@
 #include "ppapi/thunk/ppb_file_ref_api.h"
 
 using ppapi::host::ReplyMessageContext;
-using webkit::ppapi::PluginDelegate;
-
-namespace webkit {
-namespace ppapi {
-class QuotaFileIO;
-}  // namespace ppapi
-}  // namespace webkit
 
 namespace content {
+class QuotaFileIO;
 
 class PepperFileIOHost : public ppapi::host::ResourceHost,
                          public base::SupportsWeakPtr<PepperFileIOHost> {
@@ -97,7 +91,7 @@
                                     int bytes_written);
 
   // TODO(victorhsieh): eliminate plugin_delegate_ as it's no longer needed.
-  webkit::ppapi::PluginDelegate* plugin_delegate_;  // Not owned.
+  PluginDelegate* plugin_delegate_;  // Not owned.
 
   base::PlatformFile file_;
 
@@ -117,7 +111,7 @@
 
   // Pointer to a QuotaFileIO instance, which is valid only while a file
   // of type PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY} is opened.
-  scoped_ptr<webkit::ppapi::QuotaFileIO> quota_file_io_;
+  scoped_ptr<QuotaFileIO> quota_file_io_;
 
   bool is_running_in_process_;
 
diff --git a/content/renderer/pepper/pepper_file_system_host.cc b/content/renderer/pepper/pepper_file_system_host.cc
index 3e60dfe..f4c469a 100644
--- a/content/renderer/pepper/pepper_file_system_host.cc
+++ b/content/renderer/pepper/pepper_file_system_host.cc
@@ -8,9 +8,9 @@
 #include "base/callback.h"
 #include "content/child/child_thread.h"
 #include "content/child/fileapi/file_system_dispatcher.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/public/renderer/render_view.h"
 #include "content/public/renderer/renderer_ppapi_host.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "ppapi/c/pp_errors.h"
 #include "ppapi/host/dispatch_host_message.h"
 #include "ppapi/host/ppapi_host.h"
@@ -117,7 +117,7 @@
       return PP_ERROR_FAILED;
   }
 
-  webkit::ppapi::PluginInstance* plugin_instance =
+  PepperPluginInstance* plugin_instance =
       renderer_ppapi_host_->GetPluginInstance(pp_instance());
   if (!plugin_instance)
     return PP_ERROR_FAILED;
diff --git a/content/renderer/pepper/pepper_graphics_2d_host.cc b/content/renderer/pepper/pepper_graphics_2d_host.cc
index ca4d524..7dbde94 100644
--- a/content/renderer/pepper/pepper_graphics_2d_host.cc
+++ b/content/renderer/pepper/pepper_graphics_2d_host.cc
@@ -11,7 +11,7 @@
 #include "content/public/renderer/renderer_ppapi_host.h"
 #include "content/renderer/pepper/common.h"
 #include "content/renderer/pepper/gfx_conversion.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/ppb_image_data_impl.h"
 #include "content/renderer/pepper/resource_helper.h"
 #include "ppapi/c/pp_bool.h"
@@ -41,8 +41,6 @@
 
 using ppapi::thunk::EnterResourceNoLock;
 using ppapi::thunk::PPB_ImageData_API;
-using webkit::ppapi::ImageDataAutoMapper;
-using webkit::ppapi::PPB_ImageData_Impl;
 
 namespace content {
 
@@ -296,7 +294,7 @@
 }
 
 bool PepperGraphics2DHost::BindToInstance(
-    webkit::ppapi::PluginInstanceImpl* new_instance) {
+    PepperPluginInstanceImpl* new_instance) {
   if (new_instance && new_instance->pp_instance() != pp_instance())
     return false;  // Can't bind other instance's contexts.
   if (bound_instance_ == new_instance)
@@ -338,7 +336,7 @@
   gfx::Size image_size = gfx::ToFlooredSize(
       gfx::ScaleSize(pixel_image_size, scale_));
 
-  webkit::ppapi::PluginInstance* plugin_instance =
+  PepperPluginInstance* plugin_instance =
       renderer_ppapi_host_->GetPluginInstance(pp_instance());
   if (!plugin_instance)
     return;
@@ -413,7 +411,7 @@
   return is_always_opaque_;
 }
 
-webkit::ppapi::PPB_ImageData_Impl* PepperGraphics2DHost::ImageData() {
+PPB_ImageData_Impl* PepperGraphics2DHost::ImageData() {
   return image_data_.get();
 }
 
@@ -602,8 +600,7 @@
         operation.type = QueuedOperation::PAINT;
       }
 
-      gfx::Rect clip = webkit::ppapi::PP_ToGfxRect(
-          bound_instance_->view_data().clip_rect);
+      gfx::Rect clip = PP_ToGfxRect(bound_instance_->view_data().clip_rect);
       is_plugin_visible = !clip.IsEmpty();
 
       // Set |no_update_visible| to false if the change overlaps the visible
diff --git a/content/renderer/pepper/pepper_graphics_2d_host.h b/content/renderer/pepper/pepper_graphics_2d_host.h
index a582f2e..af379bf 100644
--- a/content/renderer/pepper/pepper_graphics_2d_host.h
+++ b/content/renderer/pepper/pepper_graphics_2d_host.h
@@ -22,22 +22,15 @@
 class Rect;
 }
 
-namespace webkit {
-namespace ppapi {
-class PPB_ImageData_Impl;
-class PluginInstanceImpl;
-}  // namespace ppapi
-}  // namespace webkit
-
-using webkit::ppapi::PPB_ImageData_Impl;
-
 namespace content {
-
+  
+class PepperPluginInstanceImpl;
+class PPB_ImageData_Impl;
 class RendererPpapiHost;
 
 class CONTENT_EXPORT PepperGraphics2DHost
     : public ppapi::host::ResourceHost,
-      public webkit::ppapi::PluginDelegate::PlatformGraphics2D,
+      public PluginDelegate::PlatformGraphics2D,
       public base::SupportsWeakPtr<PepperGraphics2DHost> {
  public:
   static PepperGraphics2DHost* Create(RendererPpapiHost* host,
@@ -57,8 +50,7 @@
   // PlatformGraphics2D overrides.
   virtual bool ReadImageData(PP_Resource image,
                              const PP_Point* top_left) OVERRIDE;
-  virtual bool BindToInstance(
-      webkit::ppapi::PluginInstanceImpl* new_instance) OVERRIDE;
+  virtual bool BindToInstance(PepperPluginInstanceImpl* new_instance) OVERRIDE;
   virtual void Paint(WebKit::WebCanvas* canvas,
                      const gfx::Rect& plugin_rect,
                      const gfx::Rect& paint_rect) OVERRIDE;
@@ -142,7 +134,7 @@
 
   // Non-owning pointer to the plugin instance this context is currently bound
   // to, if any. If the context is currently unbound, this will be NULL.
-  webkit::ppapi::PluginInstanceImpl* bound_instance_;
+  PepperPluginInstanceImpl* bound_instance_;
 
   // Keeps track of all drawing commands queued before a Flush call.
   struct QueuedOperation;
diff --git a/content/renderer/pepper/pepper_in_process_resource_creation.cc b/content/renderer/pepper/pepper_in_process_resource_creation.cc
index f9713c4..3732583 100644
--- a/content/renderer/pepper/pepper_in_process_resource_creation.cc
+++ b/content/renderer/pepper/pepper_in_process_resource_creation.cc
@@ -8,14 +8,14 @@
 #include "base/logging.h"
 #include "base/memory/weak_ptr.h"
 #include "base/message_loop/message_loop.h"
+#include "content/child/browser_font_resource_trusted.h"
 #include "content/renderer/pepper/pepper_in_process_router.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/renderer_ppapi_host_impl.h"
 #include "content/renderer/render_view_impl.h"
 #include "ipc/ipc_message.h"
 #include "ipc/ipc_message_macros.h"
 #include "ppapi/host/ppapi_host.h"
-#include "ppapi/proxy/browser_font_resource_trusted.h"
 #include "ppapi/proxy/ext_crx_file_system_private_resource.h"
 #include "ppapi/proxy/file_chooser_resource.h"
 #include "ppapi/proxy/file_io_resource.h"
@@ -42,7 +42,7 @@
 
 PepperInProcessResourceCreation::PepperInProcessResourceCreation(
     RendererPpapiHostImpl* host_impl,
-    webkit::ppapi::PluginInstanceImpl* instance)
+    PepperPluginInstanceImpl* instance)
     : ResourceCreationImpl(instance),
       host_impl_(host_impl) {
 }
@@ -53,12 +53,11 @@
 PP_Resource PepperInProcessResourceCreation::CreateBrowserFont(
     PP_Instance instance,
     const PP_BrowserFont_Trusted_Description* description) {
-  if (!ppapi::proxy::BrowserFontResource_Trusted::IsPPFontDescriptionValid(
-      *description))
+  if (!BrowserFontResource_Trusted::IsPPFontDescriptionValid(*description))
     return 0;
   ppapi::Preferences prefs(
       host_impl_->GetRenderViewForInstance(instance)->GetWebkitPreferences());
-  return (new ppapi::proxy::BrowserFontResource_Trusted(
+  return (new BrowserFontResource_Trusted(
       host_impl_->in_process_router()->GetPluginConnection(instance),
       instance,
       *description,
diff --git a/content/renderer/pepper/pepper_in_process_resource_creation.h b/content/renderer/pepper/pepper_in_process_resource_creation.h
index 72a5943..985ae09 100644
--- a/content/renderer/pepper/pepper_in_process_resource_creation.h
+++ b/content/renderer/pepper/pepper_in_process_resource_creation.h
@@ -34,11 +34,10 @@
 // When we convert all resources to use the new-style, we can just use the
 // ResourceCreationProxy for all resources. This class is just glue to manage
 // the temporary "two different cases."
-class PepperInProcessResourceCreation
-    : public webkit::ppapi::ResourceCreationImpl {
+class PepperInProcessResourceCreation : public ResourceCreationImpl {
  public:
   PepperInProcessResourceCreation(RendererPpapiHostImpl* host_impl,
-                                  webkit::ppapi::PluginInstanceImpl* instance);
+                                  PepperPluginInstanceImpl* instance);
   virtual ~PepperInProcessResourceCreation();
 
   // ResourceCreation_API implementation.
diff --git a/content/renderer/pepper/pepper_platform_audio_input_impl.cc b/content/renderer/pepper/pepper_platform_audio_input_impl.cc
index 436afc2..68ce940 100644
--- a/content/renderer/pepper/pepper_platform_audio_input_impl.cc
+++ b/content/renderer/pepper/pepper_platform_audio_input_impl.cc
@@ -25,7 +25,7 @@
     const GURL& document_url,
     int sample_rate,
     int frames_per_buffer,
-    webkit::ppapi::PluginDelegate::PlatformAudioInputClient* client) {
+    PluginDelegate::PlatformAudioInputClient* client) {
   scoped_refptr<PepperPlatformAudioInputImpl> audio_input(
       new PepperPlatformAudioInputImpl());
   if (audio_input->Initialize(plugin_delegate, device_id, document_url,
@@ -143,7 +143,7 @@
     const GURL& document_url,
     int sample_rate,
     int frames_per_buffer,
-    webkit::ppapi::PluginDelegate::PlatformAudioInputClient* client) {
+    PluginDelegate::PlatformAudioInputClient* client) {
   DCHECK(main_message_loop_proxy_->BelongsToCurrentThread());
 
   if (!plugin_delegate.get() || !client)
diff --git a/content/renderer/pepper/pepper_platform_audio_input_impl.h b/content/renderer/pepper/pepper_platform_audio_input_impl.h
index c5b3fb0..3c18e7c 100644
--- a/content/renderer/pepper/pepper_platform_audio_input_impl.h
+++ b/content/renderer/pepper/pepper_platform_audio_input_impl.h
@@ -35,7 +35,7 @@
 // I/O thread.
 
 class PepperPlatformAudioInputImpl
-    : public webkit::ppapi::PluginDelegate::PlatformAudioInput,
+    : public PluginDelegate::PlatformAudioInput,
       public media::AudioInputIPCDelegate,
       public base::RefCountedThreadSafe<PepperPlatformAudioInputImpl> {
  public:
@@ -47,7 +47,7 @@
       const GURL& document_url,
       int sample_rate,
       int frames_per_buffer,
-      webkit::ppapi::PluginDelegate::PlatformAudioInputClient* client);
+      PluginDelegate::PlatformAudioInputClient* client);
 
   // PlatformAudioInput implementation (called on main thread).
   virtual void StartCapture() OVERRIDE;
@@ -78,7 +78,7 @@
       const GURL& document_url,
       int sample_rate,
       int frames_per_buffer,
-      webkit::ppapi::PluginDelegate::PlatformAudioInputClient* client);
+      PluginDelegate::PlatformAudioInputClient* client);
 
   // I/O thread backends to above functions.
   void InitializeOnIOThread(int session_id);
@@ -94,7 +94,7 @@
 
   // The client to notify when the stream is created. THIS MUST ONLY BE
   // ACCESSED ON THE MAIN THREAD.
-  webkit::ppapi::PluginDelegate::PlatformAudioInputClient* client_;
+  PluginDelegate::PlatformAudioInputClient* client_;
 
   // Used to send/receive IPC. THIS MUST ONLY BE ACCESSED ON THE
   // I/O THREAD.
diff --git a/content/renderer/pepper/pepper_platform_audio_output_impl.cc b/content/renderer/pepper/pepper_platform_audio_output_impl.cc
index f4dde37..320d211 100644
--- a/content/renderer/pepper/pepper_platform_audio_output_impl.cc
+++ b/content/renderer/pepper/pepper_platform_audio_output_impl.cc
@@ -21,7 +21,7 @@
     int sample_rate,
     int frames_per_buffer,
     int source_render_view_id,
-    webkit::ppapi::PluginDelegate::PlatformAudioOutputClient* client) {
+    PluginDelegate::PlatformAudioOutputClient* client) {
   scoped_refptr<PepperPlatformAudioOutputImpl> audio_output(
       new PepperPlatformAudioOutputImpl());
   if (audio_output->Initialize(sample_rate, frames_per_buffer,
@@ -116,7 +116,7 @@
     int sample_rate,
     int frames_per_buffer,
     int source_render_view_id,
-    webkit::ppapi::PluginDelegate::PlatformAudioOutputClient* client) {
+    PluginDelegate::PlatformAudioOutputClient* client) {
   DCHECK(client);
   client_ = client;
 
diff --git a/content/renderer/pepper/pepper_platform_audio_output_impl.h b/content/renderer/pepper/pepper_platform_audio_output_impl.h
index d13aa62..af94e02 100644
--- a/content/renderer/pepper/pepper_platform_audio_output_impl.h
+++ b/content/renderer/pepper/pepper_platform_audio_output_impl.h
@@ -22,7 +22,7 @@
 namespace content {
 
 class PepperPlatformAudioOutputImpl
-    : public webkit::ppapi::PluginDelegate::PlatformAudioOutput,
+    : public PluginDelegate::PlatformAudioOutput,
       public media::AudioOutputIPCDelegate,
       public base::RefCountedThreadSafe<PepperPlatformAudioOutputImpl> {
  public:
@@ -32,7 +32,7 @@
       int sample_rate,
       int frames_per_buffer,
       int source_render_view_id,
-      webkit::ppapi::PluginDelegate::PlatformAudioOutputClient* client);
+      PluginDelegate::PlatformAudioOutputClient* client);
 
   // PlatformAudioOutput implementation (called on main thread).
   virtual bool StartPlayback() OVERRIDE;
@@ -59,7 +59,7 @@
       int sample_rate,
       int frames_per_buffer,
       int source_render_view_id,
-      webkit::ppapi::PluginDelegate::PlatformAudioOutputClient* client);
+      PluginDelegate::PlatformAudioOutputClient* client);
 
   // I/O thread backends to above functions.
   void InitializeOnIOThread(const media::AudioParameters& params);
@@ -69,7 +69,7 @@
 
   // The client to notify when the stream is created. THIS MUST ONLY BE
   // ACCESSED ON THE MAIN THREAD.
-  webkit::ppapi::PluginDelegate::PlatformAudioOutputClient* client_;
+  PluginDelegate::PlatformAudioOutputClient* client_;
 
   // Used to send/receive IPC. THIS MUST ONLY BE ACCESSED ON THE
   // I/O thread except to send messages and get the message loop.
diff --git a/content/renderer/pepper/pepper_platform_context_3d_impl.h b/content/renderer/pepper/pepper_platform_context_3d_impl.h
index c975453..609cdcc 100644
--- a/content/renderer/pepper/pepper_platform_context_3d_impl.h
+++ b/content/renderer/pepper/pepper_platform_context_3d_impl.h
@@ -24,8 +24,7 @@
 class ContextProviderCommandBuffer;
 class GpuChannelHost;
 
-class PlatformContext3DImpl
-    : public webkit::ppapi::PluginDelegate::PlatformContext3D {
+class PlatformContext3DImpl : public PluginDelegate::PlatformContext3D {
  public:
   explicit PlatformContext3DImpl();
   virtual ~PlatformContext3DImpl();
diff --git a/content/renderer/pepper/pepper_platform_image_2d_impl.h b/content/renderer/pepper/pepper_platform_image_2d_impl.h
index 5ad75e1..3ff8de4 100644
--- a/content/renderer/pepper/pepper_platform_image_2d_impl.h
+++ b/content/renderer/pepper/pepper_platform_image_2d_impl.h
@@ -11,8 +11,7 @@
 namespace content {
 
 // Implements the Image2D using a TransportDIB.
-class PepperPlatformImage2DImpl
-    : public webkit::ppapi::PluginDelegate::PlatformImage2D {
+class PepperPlatformImage2DImpl : public PluginDelegate::PlatformImage2D {
  public:
   virtual ~PepperPlatformImage2DImpl();
 
diff --git a/content/renderer/pepper/pepper_platform_video_capture_impl.cc b/content/renderer/pepper/pepper_platform_video_capture_impl.cc
index c922c03..fd121a6 100644
--- a/content/renderer/pepper/pepper_platform_video_capture_impl.cc
+++ b/content/renderer/pepper/pepper_platform_video_capture_impl.cc
@@ -19,7 +19,7 @@
     const base::WeakPtr<PepperPluginDelegateImpl>& plugin_delegate,
     const std::string& device_id,
     const GURL& document_url,
-    webkit::ppapi::PluginDelegate::PlatformVideoCaptureEventHandler* handler)
+    PluginDelegate::PlatformVideoCaptureEventHandler* handler)
     : plugin_delegate_(plugin_delegate),
       device_id_(device_id),
       session_id_(0),
diff --git a/content/renderer/pepper/pepper_platform_video_capture_impl.h b/content/renderer/pepper/pepper_platform_video_capture_impl.h
index 58101e5..40dc8e0 100644
--- a/content/renderer/pepper/pepper_platform_video_capture_impl.h
+++ b/content/renderer/pepper/pepper_platform_video_capture_impl.h
@@ -26,16 +26,16 @@
 class PepperPluginDelegateImpl;
 
 class PepperPlatformVideoCaptureImpl
-    : public webkit::ppapi::PluginDelegate::PlatformVideoCapture,
+    : public PluginDelegate::PlatformVideoCapture,
       public media::VideoCapture::EventHandler {
  public:
   PepperPlatformVideoCaptureImpl(
       const base::WeakPtr<PepperPluginDelegateImpl>& plugin_delegate,
       const std::string& device_id,
       const GURL& document_url,
-      webkit::ppapi::PluginDelegate::PlatformVideoCaptureEventHandler* handler);
+      PluginDelegate::PlatformVideoCaptureEventHandler* handler);
 
-  // webkit::ppapi::PluginDelegate::PlatformVideoCapture implementation.
+  // PluginDelegate::PlatformVideoCapture implementation.
   virtual void StartCapture(
       media::VideoCapture::EventHandler* handler,
       const media::VideoCaptureCapability& capability) OVERRIDE;
@@ -77,7 +77,7 @@
 
   scoped_ptr<media::VideoCaptureHandlerProxy> handler_proxy_;
 
-  webkit::ppapi::PluginDelegate::PlatformVideoCaptureEventHandler* handler_;
+  PluginDelegate::PlatformVideoCaptureEventHandler* handler_;
 
   media::VideoCapture* video_capture_;
 
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
index 9eaa2ab..55c3e12 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
@@ -19,10 +19,8 @@
 #include "base/sync_socket.h"
 #include "base/time/time.h"
 #include "content/child/child_process.h"
-#include "content/child/child_thread.h"
 #include "content/child/fileapi/file_system_dispatcher.h"
 #include "content/child/npapi/webplugin.h"
-#include "content/child/quota_dispatcher.h"
 #include "content/common/child_process_messages.h"
 #include "content/common/fileapi/file_system_messages.h"
 #include "content/common/gpu/client/context_provider_command_buffer.h"
@@ -33,6 +31,8 @@
 #include "content/public/common/content_switches.h"
 #include "content/public/common/context_menu_params.h"
 #include "content/public/common/media_stream_request.h"
+#include "content/public/common/page_zoom.h"
+#include "content/public/common/referrer.h"
 #include "content/public/common/webplugininfo.h"
 #include "content/public/renderer/content_renderer_client.h"
 #include "content/public/renderer/renderer_restrict_dispatch_group.h"
@@ -54,12 +54,12 @@
 #include "content/renderer/pepper/pepper_platform_context_3d_impl.h"
 #include "content/renderer/pepper/pepper_platform_image_2d_impl.h"
 #include "content/renderer/pepper/pepper_platform_video_capture_impl.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/pepper_plugin_registry.h"
 #include "content/renderer/pepper/pepper_proxy_channel_delegate_impl.h"
 #include "content/renderer/pepper/pepper_url_loader_host.h"
+#include "content/renderer/pepper/pepper_webplugin_impl.h"
 #include "content/renderer/pepper/plugin_module.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
-#include "content/renderer/pepper/ppapi_webplugin_impl.h"
 #include "content/renderer/pepper/ppb_tcp_server_socket_private_impl.h"
 #include "content/renderer/pepper/ppb_tcp_socket_private_impl.h"
 #include "content/renderer/pepper/renderer_ppapi_host_impl.h"
@@ -102,7 +102,6 @@
 #include "ui/gfx/size.h"
 #include "url/gurl.h"
 
-using WebKit::WebView;
 using WebKit::WebFrame;
 
 namespace content {
@@ -112,10 +111,9 @@
 // This class wraps a dispatcher and has the same lifetime. A dispatcher has
 // the same lifetime as a plugin module, which is longer than any particular
 // RenderView or plugin instance.
-class HostDispatcherWrapper
-    : public webkit::ppapi::PluginDelegate::OutOfProcessProxy {
+class HostDispatcherWrapper : public PluginDelegate::OutOfProcessProxy {
  public:
-  HostDispatcherWrapper(webkit::ppapi::PluginModule* module,
+  HostDispatcherWrapper(PluginModule* module,
                         base::ProcessId peer_pid,
                         int plugin_child_id,
                         const ppapi::PpapiPermissions& perms,
@@ -174,8 +172,7 @@
     // isn't true for browser tag support.
     if (host) {
       RenderView* render_view = host->GetRenderViewForInstance(instance);
-      webkit::ppapi::PluginInstance* plugin_instance =
-          host->GetPluginInstance(instance);
+      PepperPluginInstance* plugin_instance = host->GetPluginInstance(instance);
       render_view->Send(new ViewHostMsg_DidCreateOutOfProcessPepperInstance(
           plugin_child_id_,
           instance,
@@ -212,7 +209,7 @@
   ppapi::proxy::HostDispatcher* dispatcher() { return dispatcher_.get(); }
 
  private:
-  webkit::ppapi::PluginModule* module_;
+  PluginModule* module_;
 
   base::ProcessId peer_pid_;
 
@@ -228,26 +225,9 @@
   scoped_ptr<ppapi::proxy::ProxyChannel::Delegate> dispatcher_delegate_;
 };
 
-class QuotaCallbackTranslator : public QuotaDispatcher::Callback {
- public:
-  typedef webkit::ppapi::PluginDelegate::AvailableSpaceCallback PluginCallback;
-  explicit QuotaCallbackTranslator(const PluginCallback& cb) : callback_(cb) {}
-  virtual void DidQueryStorageUsageAndQuota(int64 usage, int64 quota) OVERRIDE {
-    callback_.Run(std::max(static_cast<int64>(0), quota - usage));
-  }
-  virtual void DidGrantStorageQuota(int64 granted_quota) OVERRIDE {
-    NOTREACHED();
-  }
-  virtual void DidFail(quota::QuotaStatusCode error) OVERRIDE {
-    callback_.Run(0);
-  }
- private:
-  PluginCallback callback_;
-};
-
 class PluginInstanceLockTarget : public MouseLockDispatcher::LockTarget {
  public:
-  PluginInstanceLockTarget(webkit::ppapi::PluginInstanceImpl* plugin)
+  PluginInstanceLockTarget(PepperPluginInstanceImpl* plugin)
       : plugin_(plugin) {}
 
   virtual void OnLockMouseACK(bool succeeded) OVERRIDE {
@@ -265,7 +245,7 @@
   }
 
  private:
-  webkit::ppapi::PluginInstanceImpl* plugin_;
+  PepperPluginInstanceImpl* plugin_;
 };
 
 void DoNotifyCloseFile(int file_open_id, base::PlatformFileError /* unused */) {
@@ -274,8 +254,7 @@
 }
 
 void DidOpenFileSystemURL(
-    const webkit::ppapi::PluginDelegate::AsyncOpenFileSystemURLCallback&
-        callback,
+    const PluginDelegate::AsyncOpenFileSystemURLCallback& callback,
     base::PlatformFile file,
     int file_open_id,
     quota::QuotaLimitType quota_policy) {
@@ -293,18 +272,17 @@
 }
 
 void DidFailOpenFileSystemURL(
-    const webkit::ppapi::PluginDelegate::AsyncOpenFileSystemURLCallback&
-        callback,
+    const PluginDelegate::AsyncOpenFileSystemURLCallback& callback,
     base::PlatformFileError error_code) {
   base::PlatformFile invalid_file = base::kInvalidPlatformFileValue;
   callback.Run(error_code,
                base::PassPlatformFile(&invalid_file),
                quota::kQuotaLimitTypeUnknown,
-               webkit::ppapi::PluginDelegate::NotifyCloseFileCallback());
+               PluginDelegate::NotifyCloseFileCallback());
 }
 
 void CreateHostForInProcessModule(RenderViewImpl* render_view,
-                                  webkit::ppapi::PluginModule* module,
+                                  PluginModule* module,
                                   const WebPluginInfo& webplugin_info) {
   // First time an in-process plugin was used, make a host for it.
   const PepperPluginInfo* info =
@@ -349,28 +327,27 @@
     const WebPluginInfo& webplugin_info,
     const WebKit::WebPluginParams& params) {
   bool pepper_plugin_was_registered = false;
-  scoped_refptr<webkit::ppapi::PluginModule> pepper_module(
+  scoped_refptr<PluginModule> pepper_module(
       CreatePepperPluginModule(webplugin_info, &pepper_plugin_was_registered));
 
   if (pepper_plugin_was_registered) {
     if (!pepper_module.get())
       return NULL;
-    return new webkit::ppapi::WebPluginImpl(
+    return new PepperWebPluginImpl(
         pepper_module.get(), params, AsWeakPtr(), render_view_->AsWeakPtr());
   }
 
   return NULL;
 }
 
-scoped_refptr<webkit::ppapi::PluginModule>
-PepperPluginDelegateImpl::CreatePepperPluginModule(
+scoped_refptr<PluginModule> PepperPluginDelegateImpl::CreatePepperPluginModule(
     const WebPluginInfo& webplugin_info,
     bool* pepper_plugin_was_registered) {
   *pepper_plugin_was_registered = true;
 
   // See if a module has already been loaded for this plugin.
   base::FilePath path(webplugin_info.path);
-  scoped_refptr<webkit::ppapi::PluginModule> module =
+  scoped_refptr<PluginModule> module =
       PepperPluginRegistry::GetInstance()->GetLiveModule(path);
   if (module.get()) {
     if (!module->GetEmbedderState()) {
@@ -389,10 +366,10 @@
       PepperPluginRegistry::GetInstance()->GetInfoForPlugin(webplugin_info);
   if (!info) {
     *pepper_plugin_was_registered = false;
-    return scoped_refptr<webkit::ppapi::PluginModule>();
+    return scoped_refptr<PluginModule>();
   } else if (!info->is_out_of_process) {
     // In-process plugin not preloaded, it probably couldn't be initialized.
-    return scoped_refptr<webkit::ppapi::PluginModule>();
+    return scoped_refptr<PluginModule>();
   }
 
   ppapi::PpapiPermissions permissions =
@@ -406,14 +383,12 @@
       path, &channel_handle, &peer_pid, &plugin_child_id));
   if (channel_handle.name.empty()) {
     // Couldn't be initialized.
-    return scoped_refptr<webkit::ppapi::PluginModule>();
+    return scoped_refptr<PluginModule>();
   }
 
   // AddLiveModule must be called before any early returns since the
   // module's destructor will remove itself.
-  module = new webkit::ppapi::PluginModule(
-      info->name, path,
-      permissions);
+  module = new PluginModule(info->name, path, permissions);
   PepperPluginRegistry::GetInstance()->AddLiveModule(path, module.get());
 
   if (!CreateOutOfProcessModule(module.get(),
@@ -423,13 +398,13 @@
                                 peer_pid,
                                 plugin_child_id,
                                 false))  // is_external = false
-    return scoped_refptr<webkit::ppapi::PluginModule>();
+    return scoped_refptr<PluginModule>();
 
   return module;
 }
 
 scoped_refptr<PepperBrokerImpl> PepperPluginDelegateImpl::CreateBroker(
-    webkit::ppapi::PluginModule* plugin_module) {
+    PluginModule* plugin_module) {
   DCHECK(plugin_module);
   DCHECK(!plugin_module->GetBroker());
 
@@ -456,7 +431,7 @@
 }
 
 RendererPpapiHost* PepperPluginDelegateImpl::CreateOutOfProcessModule(
-    webkit::ppapi::PluginModule* module,
+    PluginModule* module,
     const base::FilePath& path,
     ppapi::PpapiPermissions permissions,
     const IPC::ChannelHandle& channel_handle,
@@ -475,7 +450,7 @@
                                 is_external));
   if (!dispatcher->Init(
           channel_handle,
-          webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(),
+          PluginModule::GetLocalGetInterfaceFunc(),
           GetPreferences(),
           hung_filter.get()))
     return NULL;
@@ -529,7 +504,7 @@
   // Notify all of our instances that we started painting. This is used for
   // internal bookkeeping only, so we know that the set can not change under
   // us.
-  for (std::set<webkit::ppapi::PluginInstanceImpl*>::iterator i =
+  for (std::set<PepperPluginInstanceImpl*>::iterator i =
            active_instances_.begin();
        i != active_instances_.end(); ++i)
     (*i)->ViewWillInitiatePaint();
@@ -539,9 +514,8 @@
   // Notify all instances that we painted.  The same caveats apply as for
   // ViewFlushedPaint regarding instances closing themselves, so we take
   // similar precautions.
-  std::set<webkit::ppapi::PluginInstanceImpl*> plugins = active_instances_;
-  for (std::set<webkit::ppapi::PluginInstanceImpl*>::iterator i =
-          plugins.begin();
+  std::set<PepperPluginInstanceImpl*> plugins = active_instances_;
+  for (std::set<PepperPluginInstanceImpl*>::iterator i = plugins.begin();
        i != plugins.end(); ++i) {
     if (active_instances_.find(*i) != active_instances_.end())
       (*i)->ViewInitiatedPaint();
@@ -553,9 +527,8 @@
   // we it may ask to close itself as a result. This will, in turn, modify our
   // set, possibly invalidating the iterator. So we iterate on a copy that
   // won't change out from under us.
-  std::set<webkit::ppapi::PluginInstanceImpl*> plugins = active_instances_;
-  for (std::set<webkit::ppapi::PluginInstanceImpl*>::iterator i =
-           plugins.begin();
+  std::set<PepperPluginInstanceImpl*> plugins = active_instances_;
+  for (std::set<PepperPluginInstanceImpl*>::iterator i = plugins.begin();
        i != plugins.end(); ++i) {
     // The copy above makes sure our iterator is never invalid if some plugins
     // are destroyed. But some plugin may decide to close all of its views in
@@ -578,17 +551,17 @@
   }
 }
 
-webkit::ppapi::PluginInstanceImpl*
-PepperPluginDelegateImpl::GetBitmapForOptimizedPluginPaint(
-    const gfx::Rect& paint_bounds,
-    TransportDIB** dib,
-    gfx::Rect* location,
-    gfx::Rect* clip,
-    float* scale_factor) {
-  for (std::set<webkit::ppapi::PluginInstanceImpl*>::iterator i =
+PepperPluginInstanceImpl* PepperPluginDelegateImpl::
+    GetBitmapForOptimizedPluginPaint(
+        const gfx::Rect& paint_bounds,
+        TransportDIB** dib,
+        gfx::Rect* location,
+        gfx::Rect* clip,
+        float* scale_factor) {
+  for (std::set<PepperPluginInstanceImpl*>::iterator i =
            active_instances_.begin();
        i != active_instances_.end(); ++i) {
-    webkit::ppapi::PluginInstanceImpl* instance = *i;
+    PepperPluginInstanceImpl* instance = *i;
     // In Flash fullscreen , the plugin contents should be painted onto the
     // fullscreen widget instead of the web page.
     if (!instance->FlashIsFullscreenOrPending() &&
@@ -600,7 +573,7 @@
 }
 
 void PepperPluginDelegateImpl::PluginFocusChanged(
-    webkit::ppapi::PluginInstanceImpl* instance,
+    PepperPluginInstanceImpl* instance,
     bool focused) {
   if (focused)
     focused_plugin_ = instance;
@@ -611,25 +584,25 @@
 }
 
 void PepperPluginDelegateImpl::PluginTextInputTypeChanged(
-    webkit::ppapi::PluginInstanceImpl* instance) {
+    PepperPluginInstanceImpl* instance) {
   if (focused_plugin_ == instance && render_view_)
     render_view_->PpapiPluginTextInputTypeChanged();
 }
 
 void PepperPluginDelegateImpl::PluginCaretPositionChanged(
-    webkit::ppapi::PluginInstanceImpl* instance) {
+    PepperPluginInstanceImpl* instance) {
   if (focused_plugin_ == instance && render_view_)
     render_view_->PpapiPluginCaretPositionChanged();
 }
 
 void PepperPluginDelegateImpl::PluginRequestedCancelComposition(
-    webkit::ppapi::PluginInstanceImpl* instance) {
+    PepperPluginInstanceImpl* instance) {
   if (focused_plugin_ == instance && render_view_)
     render_view_->PpapiPluginCancelComposition();
 }
 
 void PepperPluginDelegateImpl::PluginSelectionChanged(
-    webkit::ppapi::PluginInstanceImpl* instance) {
+    PepperPluginInstanceImpl* instance) {
   if (focused_plugin_ == instance && render_view_)
     render_view_->PpapiPluginSelectionChanged();
 }
@@ -740,14 +713,14 @@
 }
 
 void PepperPluginDelegateImpl::PluginCrashed(
-    webkit::ppapi::PluginInstanceImpl* instance) {
+    PepperPluginInstanceImpl* instance) {
   render_view_->PluginCrashed(instance->module()->path(),
                               instance->module()->GetPeerProcessId());
   UnSetAndDeleteLockTargetAdapter(instance);
 }
 
 void PepperPluginDelegateImpl::InstanceCreated(
-    webkit::ppapi::PluginInstanceImpl* instance) {
+    PepperPluginInstanceImpl* instance) {
   active_instances_.insert(instance);
 
   // Set the initial focus.
@@ -755,7 +728,7 @@
 }
 
 void PepperPluginDelegateImpl::InstanceDeleted(
-    webkit::ppapi::PluginInstanceImpl* instance) {
+    PepperPluginInstanceImpl* instance) {
   active_instances_.erase(instance);
   UnSetAndDeleteLockTargetAdapter(instance);
 
@@ -767,7 +740,7 @@
 
 scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>
 PepperPluginDelegateImpl::CreateResourceCreationAPI(
-    webkit::ppapi::PluginInstanceImpl* instance) {
+    PepperPluginInstanceImpl* instance) {
   RendererPpapiHostImpl* host_impl = static_cast<RendererPpapiHostImpl*>(
       instance->module()->GetEmbedderState());
   return host_impl->CreateInProcessResourceCreationAPI(instance);
@@ -783,15 +756,15 @@
       render_view_, file_path);
 }
 
-webkit::ppapi::PluginDelegate::PlatformImage2D*
+PluginDelegate::PlatformImage2D*
 PepperPluginDelegateImpl::CreateImage2D(int width, int height) {
   return PepperPlatformImage2DImpl::Create(width, height);
 }
 
-webkit::ppapi::PluginDelegate::PlatformGraphics2D*
-PepperPluginDelegateImpl::GetGraphics2D(
-    webkit::ppapi::PluginInstanceImpl* instance,
-    PP_Resource resource) {
+PluginDelegate::PlatformGraphics2D*
+    PepperPluginDelegateImpl::GetGraphics2D(
+        PepperPluginInstanceImpl* instance,
+        PP_Resource resource) {
   ppapi::host::ResourceHost* host =
       GetRendererResourceHost(instance->pp_instance(), resource);
   if (!host)
@@ -801,7 +774,7 @@
   return result;
 }
 
-webkit::ppapi::PluginDelegate::PlatformContext3D*
+PluginDelegate::PlatformContext3D*
     PepperPluginDelegateImpl::CreateContext3D() {
   // If accelerated compositing of plugins is disabled, fail to create a 3D
   // context, because it won't be visible. This allows graceful fallback in the
@@ -812,19 +785,19 @@
   return new PlatformContext3DImpl;
 }
 
-webkit::ppapi::PluginDelegate::PlatformVideoCapture*
-PepperPluginDelegateImpl::CreateVideoCapture(
-    const std::string& device_id,
-    const GURL& document_url,
-    PlatformVideoCaptureEventHandler* handler) {
+PluginDelegate::PlatformVideoCapture*
+    PepperPluginDelegateImpl::CreateVideoCapture(
+        const std::string& device_id,
+        const GURL& document_url,
+        PlatformVideoCaptureEventHandler* handler) {
   return new PepperPlatformVideoCaptureImpl(AsWeakPtr(), device_id,
                                             document_url, handler);
 }
 
-webkit::ppapi::PluginDelegate::PlatformVideoDecoder*
-PepperPluginDelegateImpl::CreateVideoDecoder(
-    media::VideoDecodeAccelerator::Client* client,
-    int32 command_buffer_route_id) {
+PluginDelegate::PlatformVideoDecoder*
+    PepperPluginDelegateImpl::CreateVideoDecoder(
+        media::VideoDecodeAccelerator::Client* client,
+        int32 command_buffer_route_id) {
   return new PlatformVideoDecoderImpl(client, command_buffer_route_id);
 }
 
@@ -850,36 +823,33 @@
   return thread->GetAudioHardwareConfig()->GetOutputBufferSize();
 }
 
-webkit::ppapi::PluginDelegate::PlatformAudioOutput*
-PepperPluginDelegateImpl::CreateAudioOutput(
-    uint32_t sample_rate,
-    uint32_t sample_count,
-    webkit::ppapi::PluginDelegate::PlatformAudioOutputClient* client) {
+PluginDelegate::PlatformAudioOutput*
+    PepperPluginDelegateImpl::CreateAudioOutput(
+        uint32_t sample_rate,
+        uint32_t sample_count,
+        PluginDelegate::PlatformAudioOutputClient* client) {
   return PepperPlatformAudioOutputImpl::Create(
       static_cast<int>(sample_rate), static_cast<int>(sample_count),
       GetRoutingID(), client);
 }
 
-webkit::ppapi::PluginDelegate::PlatformAudioInput*
-PepperPluginDelegateImpl::CreateAudioInput(
+PluginDelegate::PlatformAudioInput* PepperPluginDelegateImpl::CreateAudioInput(
     const std::string& device_id,
     const GURL& document_url,
     uint32_t sample_rate,
     uint32_t sample_count,
-    webkit::ppapi::PluginDelegate::PlatformAudioInputClient* client) {
+    PluginDelegate::PlatformAudioInputClient* client) {
   return PepperPlatformAudioInputImpl::Create(
       AsWeakPtr(), device_id, document_url, static_cast<int>(sample_rate),
       static_cast<int>(sample_count), client);
 }
 
 // If a broker has not already been created for this plugin, creates one.
-webkit::ppapi::PluginDelegate::Broker*
-PepperPluginDelegateImpl::ConnectToBroker(
-    webkit::ppapi::PPB_Broker_Impl* client) {
+PluginDelegate::Broker* PepperPluginDelegateImpl::ConnectToBroker(
+    PPB_Broker_Impl* client) {
   DCHECK(client);
 
-  webkit::ppapi::PluginModule* plugin_module =
-      webkit::ppapi::ResourceHelper::GetPluginModule(client);
+  PluginModule* plugin_module = ResourceHelper::GetPluginModule(client);
   if (!plugin_module)
     return NULL;
 
@@ -892,7 +862,7 @@
   }
 
   int request_id = pending_permission_requests_.Add(
-      new base::WeakPtr<webkit::ppapi::PPB_Broker_Impl>(client->AsWeakPtr()));
+      new base::WeakPtr<PPB_Broker_Impl>(client->AsWeakPtr()));
   if (!render_view_->Send(
           new ViewHostMsg_RequestPpapiBrokerPermission(
               render_view_->routing_id(),
@@ -912,16 +882,15 @@
 void PepperPluginDelegateImpl::OnPpapiBrokerPermissionResult(
     int request_id,
     bool result) {
-  scoped_ptr<base::WeakPtr<webkit::ppapi::PPB_Broker_Impl> > client_ptr(
+  scoped_ptr<base::WeakPtr<PPB_Broker_Impl> > client_ptr(
       pending_permission_requests_.Lookup(request_id));
   DCHECK(client_ptr.get());
   pending_permission_requests_.Remove(request_id);
-  base::WeakPtr<webkit::ppapi::PPB_Broker_Impl> client = *client_ptr;
+  base::WeakPtr<PPB_Broker_Impl> client = *client_ptr;
   if (!client.get())
     return;
 
-  webkit::ppapi::PluginModule* plugin_module =
-      webkit::ppapi::ResourceHelper::GetPluginModule(client.get());
+  PluginModule* plugin_module = ResourceHelper::GetPluginModule(client.get());
   if (!plugin_module)
     return;
 
@@ -959,14 +928,14 @@
 }
 
 void PepperPluginDelegateImpl::OnSetFocus(bool has_focus) {
-  for (std::set<webkit::ppapi::PluginInstanceImpl*>::iterator i =
+  for (std::set<PepperPluginInstanceImpl*>::iterator i =
            active_instances_.begin();
        i != active_instances_.end(); ++i)
     (*i)->SetContentAreaFocus(has_focus);
 }
 
 void PepperPluginDelegateImpl::PageVisibilityChanged(bool is_visible) {
-  for (std::set<webkit::ppapi::PluginInstanceImpl*>::iterator i =
+  for (std::set<PepperPluginInstanceImpl*>::iterator i =
            active_instances_.begin();
        i != active_instances_.end(); ++i)
     (*i)->PageVisibilityChanged(is_visible);
@@ -1091,21 +1060,6 @@
       directory_path, success_callback, error_callback);
 }
 
-void PepperPluginDelegateImpl::QueryAvailableSpace(
-    const GURL& origin, quota::StorageType type,
-    const AvailableSpaceCallback& callback) {
-  ChildThread::current()->quota_dispatcher()->QueryStorageUsageAndQuota(
-      origin, type, new QuotaCallbackTranslator(callback));
-}
-
-void PepperPluginDelegateImpl::WillUpdateFile(const GURL& path) {
-  ChildThread::current()->Send(new FileSystemHostMsg_WillUpdate(path));
-}
-
-void PepperPluginDelegateImpl::DidUpdateFile(const GURL& path, int64_t delta) {
-  ChildThread::current()->Send(new FileSystemHostMsg_DidUpdate(path, delta));
-}
-
 void PepperPluginDelegateImpl::AsyncOpenFileSystemURL(
     const GURL& path,
     int flags,
@@ -1140,7 +1094,7 @@
 }
 
 void PepperPluginDelegateImpl::TCPSocketConnect(
-    webkit::ppapi::PPB_TCPSocket_Private_Impl* socket,
+    PPB_TCPSocket_Private_Impl* socket,
     uint32 socket_id,
     const std::string& host,
     uint16_t port) {
@@ -1151,7 +1105,7 @@
 }
 
 void PepperPluginDelegateImpl::TCPSocketConnectWithNetAddress(
-      webkit::ppapi::PPB_TCPSocket_Private_Impl* socket,
+      PPB_TCPSocket_Private_Impl* socket,
       uint32 socket_id,
       const PP_NetAddress_Private& addr) {
   RegisterTCPSocket(socket, socket_id);
@@ -1202,7 +1156,7 @@
 }
 
 void PepperPluginDelegateImpl::RegisterTCPSocket(
-    webkit::ppapi::PPB_TCPSocket_Private_Impl* socket,
+    PPB_TCPSocket_Private_Impl* socket,
     uint32 socket_id) {
   tcp_sockets_.AddWithID(socket, socket_id);
 }
@@ -1265,9 +1219,8 @@
   return succeeded;
 }
 
-webkit::ppapi::FullscreenContainer*
-PepperPluginDelegateImpl::CreateFullscreenContainer(
-    webkit::ppapi::PluginInstanceImpl* instance) {
+FullscreenContainer* PepperPluginDelegateImpl::CreateFullscreenContainer(
+    PepperPluginInstanceImpl* instance) {
   return render_view_->CreatePepperFullscreenContainer(instance);
 }
 
@@ -1282,13 +1235,13 @@
 
 void PepperPluginDelegateImpl::ZoomLimitsChanged(double minimum_factor,
                                                  double maximum_factor) {
-  double minimum_level = WebView::zoomFactorToZoomLevel(minimum_factor);
-  double maximum_level = WebView::zoomFactorToZoomLevel(maximum_factor);
+  double minimum_level = ZoomFactorToZoomLevel(minimum_factor);
+  double maximum_level = ZoomFactorToZoomLevel(maximum_factor);
   render_view_->webview()->zoomLimitsChanged(minimum_level, maximum_level);
 }
 
 void PepperPluginDelegateImpl::HandleDocumentLoad(
-    webkit::ppapi::PluginInstanceImpl* instance,
+    PepperPluginInstanceImpl* instance,
     const WebKit::WebURLResponse& response) {
   DCHECK(!instance->document_loader());
 
@@ -1346,7 +1299,7 @@
 }
 
 RendererPpapiHost* PepperPluginDelegateImpl::CreateExternalPluginModule(
-    scoped_refptr<webkit::ppapi::PluginModule> module,
+    scoped_refptr<PluginModule> module,
     const base::FilePath& path,
     ppapi::PpapiPermissions permissions,
     const IPC::ChannelHandle& channel_handle,
@@ -1372,26 +1325,24 @@
   return ppapi::Preferences(render_view_->webkit_preferences());
 }
 
-bool PepperPluginDelegateImpl::LockMouse(
-    webkit::ppapi::PluginInstanceImpl* instance) {
+bool PepperPluginDelegateImpl::LockMouse(PepperPluginInstanceImpl* instance) {
   return GetMouseLockDispatcher(instance)->LockMouse(
       GetOrCreateLockTargetAdapter(instance));
 }
 
-void PepperPluginDelegateImpl::UnlockMouse(
-    webkit::ppapi::PluginInstanceImpl* instance) {
+void PepperPluginDelegateImpl::UnlockMouse(PepperPluginInstanceImpl* instance) {
   GetMouseLockDispatcher(instance)->UnlockMouse(
       GetOrCreateLockTargetAdapter(instance));
 }
 
 bool PepperPluginDelegateImpl::IsMouseLocked(
-    webkit::ppapi::PluginInstanceImpl* instance) {
+    PepperPluginInstanceImpl* instance) {
   return GetMouseLockDispatcher(instance)->IsMouseLockedTo(
       GetOrCreateLockTargetAdapter(instance));
 }
 
 void PepperPluginDelegateImpl::DidChangeCursor(
-    webkit::ppapi::PluginInstanceImpl* instance,
+    PepperPluginInstanceImpl* instance,
     const WebKit::WebCursorInfo& cursor) {
   // Update the cursor appearance immediately if the requesting plugin is the
   // one which receives the last mouse event. Otherwise, the new cursor won't be
@@ -1403,7 +1354,7 @@
 }
 
 void PepperPluginDelegateImpl::DidReceiveMouseEvent(
-    webkit::ppapi::PluginInstanceImpl* instance) {
+    PepperPluginInstanceImpl* instance) {
   last_mouse_event_target_ = instance;
 }
 
@@ -1496,8 +1447,7 @@
     int32_t result,
     const PP_NetAddress_Private& local_addr,
     const PP_NetAddress_Private& remote_addr) {
-  webkit::ppapi::PPB_TCPSocket_Private_Impl* socket =
-      tcp_sockets_.Lookup(socket_id);
+  PPB_TCPSocket_Private_Impl* socket = tcp_sockets_.Lookup(socket_id);
   if (socket)
     socket->OnConnectCompleted(result, local_addr, remote_addr);
   if (result != PP_OK)
@@ -1509,8 +1459,7 @@
     uint32 socket_id,
     bool succeeded,
     const ppapi::PPB_X509Certificate_Fields& certificate_fields) {
-  webkit::ppapi::PPB_TCPSocket_Private_Impl* socket =
-      tcp_sockets_.Lookup(socket_id);
+  PPB_TCPSocket_Private_Impl* socket = tcp_sockets_.Lookup(socket_id);
   if (socket)
     socket->OnSSLHandshakeCompleted(succeeded, certificate_fields);
 }
@@ -1519,8 +1468,7 @@
                                                   uint32 socket_id,
                                                   int32_t result,
                                                   const std::string& data) {
-  webkit::ppapi::PPB_TCPSocket_Private_Impl* socket =
-      tcp_sockets_.Lookup(socket_id);
+  PPB_TCPSocket_Private_Impl* socket = tcp_sockets_.Lookup(socket_id);
   if (socket)
     socket->OnReadCompleted(result, data);
 }
@@ -1528,8 +1476,7 @@
 void PepperPluginDelegateImpl::OnTCPSocketWriteACK(uint32 plugin_dispatcher_id,
                                                    uint32 socket_id,
                                                    int32_t result) {
-  webkit::ppapi::PPB_TCPSocket_Private_Impl* socket =
-      tcp_sockets_.Lookup(socket_id);
+  PPB_TCPSocket_Private_Impl* socket = tcp_sockets_.Lookup(socket_id);
   if (socket)
     socket->OnWriteCompleted(result);
 }
@@ -1538,8 +1485,7 @@
     uint32 plugin_dispatcher_id,
     uint32 socket_id,
     int32_t result) {
-  webkit::ppapi::PPB_TCPSocket_Private_Impl* socket =
-      tcp_sockets_.Lookup(socket_id);
+  PPB_TCPSocket_Private_Impl* socket = tcp_sockets_.Lookup(socket_id);
   if (socket)
     socket->OnSetOptionCompleted(result);
 }
@@ -1649,7 +1595,7 @@
 
 MouseLockDispatcher::LockTarget*
     PepperPluginDelegateImpl::GetOrCreateLockTargetAdapter(
-    webkit::ppapi::PluginInstanceImpl* instance) {
+    PepperPluginInstanceImpl* instance) {
   MouseLockDispatcher::LockTarget* target = mouse_lock_instances_[instance];
   if (target)
     return target;
@@ -1659,7 +1605,7 @@
 }
 
 void PepperPluginDelegateImpl::UnSetAndDeleteLockTargetAdapter(
-    webkit::ppapi::PluginInstanceImpl* instance) {
+    PepperPluginInstanceImpl* instance) {
   LockTargetMap::iterator it = mouse_lock_instances_.find(instance);
   if (it != mouse_lock_instances_.end()) {
     MouseLockDispatcher::LockTarget* target = it->second;
@@ -1670,7 +1616,7 @@
 }
 
 MouseLockDispatcher* PepperPluginDelegateImpl::GetMouseLockDispatcher(
-    webkit::ppapi::PluginInstanceImpl* instance) {
+    PepperPluginInstanceImpl* instance) {
   if (instance->flash_fullscreen()) {
     RenderWidgetFullscreenPepper* container =
         static_cast<RenderWidgetFullscreenPepper*>(
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.h b/content/renderer/pepper/pepper_plugin_delegate_impl.h
index 5a0f977..cb5ab8b 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.h
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.h
@@ -35,12 +35,6 @@
 class PPB_X509Certificate_Fields;
 }
 
-namespace webkit {
-namespace ppapi {
-class PluginModule;
-}
-}
-
 namespace WebKit {
 class WebGamepads;
 struct WebCompositionUnderline;
@@ -51,11 +45,12 @@
 class GamepadSharedMemoryReader;
 class PepperBrokerImpl;
 class PepperDeviceEnumerationEventHandler;
+class PluginModule;
 class RenderViewImpl;
 struct WebPluginInfo;
 
 class PepperPluginDelegateImpl
-    : public webkit::ppapi::PluginDelegate,
+    : public PluginDelegate,
       public RenderViewPepperHelper,
       public base::SupportsWeakPtr<PepperPluginDelegateImpl>,
       public RenderViewObserver {
@@ -103,7 +98,7 @@
   virtual void ViewWillInitiatePaint() OVERRIDE;
   virtual void ViewInitiatedPaint() OVERRIDE;
   virtual void ViewFlushedPaint() OVERRIDE;
-  virtual webkit::ppapi::PluginInstanceImpl* GetBitmapForOptimizedPluginPaint(
+  virtual PepperPluginInstanceImpl* GetBitmapForOptimizedPluginPaint(
       const gfx::Rect& paint_bounds,
       TransportDIB** dib,
       gfx::Rect* location,
@@ -136,31 +131,27 @@
   virtual void WillHandleMouseEvent() OVERRIDE;
 
   // PluginDelegate implementation.
-  virtual void PluginFocusChanged(webkit::ppapi::PluginInstanceImpl* instance,
+  virtual void PluginFocusChanged(PepperPluginInstanceImpl* instance,
                                   bool focused) OVERRIDE;
   virtual void PluginTextInputTypeChanged(
-      webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE;
+      PepperPluginInstanceImpl* instance) OVERRIDE;
   virtual void PluginCaretPositionChanged(
-      webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE;
+      PepperPluginInstanceImpl* instance) OVERRIDE;
   virtual void PluginRequestedCancelComposition(
-      webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE;
+      PepperPluginInstanceImpl* instance) OVERRIDE;
   virtual void PluginSelectionChanged(
-      webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE;
+      PepperPluginInstanceImpl* instance) OVERRIDE;
   virtual void SimulateImeSetComposition(
       const string16& text,
       const std::vector<WebKit::WebCompositionUnderline>& underlines,
       int selection_start,
       int selection_end) OVERRIDE;
   virtual void SimulateImeConfirmComposition(const string16& text) OVERRIDE;
-  virtual void PluginCrashed(
-      webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE;
-  virtual void InstanceCreated(
-      webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE;
-  virtual void InstanceDeleted(
-      webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE;
+  virtual void PluginCrashed(PepperPluginInstanceImpl* instance) OVERRIDE;
+  virtual void InstanceCreated(PepperPluginInstanceImpl* instance) OVERRIDE;
+  virtual void InstanceDeleted(PepperPluginInstanceImpl* instance) OVERRIDE;
   virtual scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>
-      CreateResourceCreationAPI(
-          webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE;
+      CreateResourceCreationAPI(PepperPluginInstanceImpl* instance) OVERRIDE;
   virtual SkBitmap* GetSadPluginBitmap() OVERRIDE;
   virtual WebKit::WebPlugin* CreatePluginReplacement(
       const base::FilePath& file_path) OVERRIDE;
@@ -178,7 +169,7 @@
       PlatformAudioInputClient* client) OVERRIDE;
   virtual PlatformImage2D* CreateImage2D(int width, int height) OVERRIDE;
   virtual PlatformGraphics2D* GetGraphics2D(
-      webkit::ppapi::PluginInstanceImpl* instance,
+      PepperPluginInstanceImpl* instance,
       PP_Resource resource) OVERRIDE;
   virtual PlatformContext3D* CreateContext3D() OVERRIDE;
   virtual PlatformVideoCapture* CreateVideoCapture(
@@ -188,8 +179,7 @@
   virtual PlatformVideoDecoder* CreateVideoDecoder(
       media::VideoDecodeAccelerator::Client* client,
       int32 command_buffer_route_id) OVERRIDE;
-  virtual Broker* ConnectToBroker(
-      webkit::ppapi::PPB_Broker_Impl* client) OVERRIDE;
+  virtual Broker* ConnectToBroker(PPB_Broker_Impl* client) OVERRIDE;
   virtual void NumberOfFindResultsChanged(int identifier,
                                           int total,
                                           bool final_result) OVERRIDE;
@@ -240,25 +230,18 @@
       const GURL& directory_path,
       const ReadDirectoryCallback& success_callback,
       const StatusCallback& error_callback) OVERRIDE;
-  virtual void QueryAvailableSpace(
-      const GURL& origin,
-      quota::StorageType type,
-      const AvailableSpaceCallback& callback) OVERRIDE;
-  virtual void WillUpdateFile(const GURL& file_path) OVERRIDE;
-  virtual void DidUpdateFile(const GURL& file_path, int64_t delta) OVERRIDE;
   virtual void SyncGetFileSystemPlatformPath(
       const GURL& url,
       base::FilePath* platform_path) OVERRIDE;
   virtual scoped_refptr<base::MessageLoopProxy>
       GetFileThreadMessageLoopProxy() OVERRIDE;
   virtual uint32 TCPSocketCreate() OVERRIDE;
-  virtual void TCPSocketConnect(
-      webkit::ppapi::PPB_TCPSocket_Private_Impl* socket,
-      uint32 socket_id,
-      const std::string& host,
-      uint16_t port) OVERRIDE;
+  virtual void TCPSocketConnect(PPB_TCPSocket_Private_Impl* socket,
+                                uint32 socket_id,
+                                const std::string& host,
+                                uint16_t port) OVERRIDE;
   virtual void TCPSocketConnectWithNetAddress(
-      webkit::ppapi::PPB_TCPSocket_Private_Impl* socket,
+      PPB_TCPSocket_Private_Impl* socket,
       uint32 socket_id,
       const PP_NetAddress_Private& addr) OVERRIDE;
   virtual void TCPSocketSSLHandshake(
@@ -275,9 +258,8 @@
       uint32 socket_id,
       PP_TCPSocket_Option name,
       const ppapi::SocketOptionData& value) OVERRIDE;
-  virtual void RegisterTCPSocket(
-      webkit::ppapi::PPB_TCPSocket_Private_Impl* socket,
-      uint32 socket_id) OVERRIDE;
+  virtual void RegisterTCPSocket(PPB_TCPSocket_Private_Impl* socket,
+                                 uint32 socket_id) OVERRIDE;
   virtual void TCPServerSocketListen(
       PP_Resource socket_resource,
       const PP_NetAddress_Private& addr,
@@ -293,9 +275,8 @@
   virtual bool X509CertificateParseDER(
       const std::vector<char>& der,
       ppapi::PPB_X509Certificate_Fields* fields) OVERRIDE;
-  virtual webkit::ppapi::FullscreenContainer*
-      CreateFullscreenContainer(
-          webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE;
+  virtual FullscreenContainer* CreateFullscreenContainer(
+      PepperPluginInstanceImpl* instance) OVERRIDE;
   virtual gfx::Size GetScreenSize() OVERRIDE;
   virtual std::string GetDefaultEncoding() OVERRIDE;
   virtual void ZoomLimitsChanged(double minimum_factor, double maximum_factor)
@@ -303,15 +284,13 @@
   virtual base::SharedMemory* CreateAnonymousSharedMemory(size_t size)
       OVERRIDE;
   virtual ::ppapi::Preferences GetPreferences() OVERRIDE;
-  virtual bool LockMouse(webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE;
-  virtual void UnlockMouse(
-      webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE;
-  virtual bool IsMouseLocked(
-      webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE;
-  virtual void DidChangeCursor(webkit::ppapi::PluginInstanceImpl* instance,
+  virtual bool LockMouse(PepperPluginInstanceImpl* instance) OVERRIDE;
+  virtual void UnlockMouse(PepperPluginInstanceImpl* instance) OVERRIDE;
+  virtual bool IsMouseLocked(PepperPluginInstanceImpl* instance) OVERRIDE;
+  virtual void DidChangeCursor(PepperPluginInstanceImpl* instance,
                                const WebKit::WebCursorInfo& cursor) OVERRIDE;
   virtual void DidReceiveMouseEvent(
-      webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE;
+      PepperPluginInstanceImpl* instance) OVERRIDE;
   virtual bool IsInFullscreenMode() OVERRIDE;
   virtual void SampleGamepads(WebKit::WebGamepads* data) OVERRIDE;
   virtual bool IsPageVisible() const OVERRIDE;
@@ -320,10 +299,10 @@
       const EnumerateDevicesCallback& callback) OVERRIDE;
   virtual void StopEnumerateDevices(int request_id) OVERRIDE;
   virtual void HandleDocumentLoad(
-      webkit::ppapi::PluginInstanceImpl* instance,
+      PepperPluginInstanceImpl* instance,
       const WebKit::WebURLResponse& response) OVERRIDE;
-  virtual content::RendererPpapiHost* CreateExternalPluginModule(
-      scoped_refptr<webkit::ppapi::PluginModule> module,
+  virtual RendererPpapiHost* CreateExternalPluginModule(
+      scoped_refptr<PluginModule> module,
       const base::FilePath& path,
       ::ppapi::PpapiPermissions permissions,
       const IPC::ChannelHandle& channel_handle,
@@ -374,18 +353,17 @@
   // the second is that the plugin failed to initialize. In this case,
   // |*pepper_plugin_was_registered| will be set to true and the caller should
   // not fall back on any other plugin types.
-  scoped_refptr<webkit::ppapi::PluginModule>
-  CreatePepperPluginModule(const WebPluginInfo& webplugin_info,
-                           bool* pepper_plugin_was_registered);
+  scoped_refptr<PluginModule> CreatePepperPluginModule(
+      const WebPluginInfo& webplugin_info,
+      bool* pepper_plugin_was_registered);
 
   // Asynchronously attempts to create a PPAPI broker for the given plugin.
-  scoped_refptr<PepperBrokerImpl> CreateBroker(
-      webkit::ppapi::PluginModule* plugin_module);
+  scoped_refptr<PepperBrokerImpl> CreateBroker(PluginModule* plugin_module);
 
   // Create a new HostDispatcher for proxying, hook it to the PluginModule,
   // and perform other common initialization.
   RendererPpapiHost* CreateOutOfProcessModule(
-      webkit::ppapi::PluginModule* module,
+      PluginModule* module,
       const base::FilePath& path,
       ppapi::PpapiPermissions permissions,
       const IPC::ChannelHandle& channel_handle,
@@ -394,12 +372,11 @@
       bool is_external);
 
   MouseLockDispatcher::LockTarget* GetOrCreateLockTargetAdapter(
-      webkit::ppapi::PluginInstanceImpl* instance);
-  void UnSetAndDeleteLockTargetAdapter(
-      webkit::ppapi::PluginInstanceImpl* instance);
+      PepperPluginInstanceImpl* instance);
+  void UnSetAndDeleteLockTargetAdapter(PepperPluginInstanceImpl* instance);
 
   MouseLockDispatcher* GetMouseLockDispatcher(
-      webkit::ppapi::PluginInstanceImpl* instance);
+      PepperPluginInstanceImpl* instance);
 
   // Share a given handle with the target process.
   virtual IPC::PlatformFileForTransit ShareHandleWithRemote(
@@ -416,26 +393,25 @@
   // the browser.
   PepperBrowserConnection pepper_browser_connection_;
 
-  std::set<webkit::ppapi::PluginInstanceImpl*> active_instances_;
-  typedef std::map<webkit::ppapi::PluginInstanceImpl*,
+  std::set<PepperPluginInstanceImpl*> active_instances_;
+  typedef std::map<PepperPluginInstanceImpl*,
                    MouseLockDispatcher::LockTarget*> LockTargetMap;
   LockTargetMap mouse_lock_instances_;
 
   IDMap<AsyncOpenFileCallback> pending_async_open_files_;
 
-  IDMap<webkit::ppapi::PPB_TCPSocket_Private_Impl> tcp_sockets_;
+  IDMap<PPB_TCPSocket_Private_Impl> tcp_sockets_;
 
   IDMap<ppapi::PPB_TCPServerSocket_Shared> tcp_server_sockets_;
 
   typedef IDMap<scoped_refptr<PepperBrokerImpl>, IDMapOwnPointer> BrokerMap;
   BrokerMap pending_connect_broker_;
 
-  typedef IDMap<base::WeakPtr<webkit::ppapi::PPB_Broker_Impl> >
-      PermissionRequestMap;
+  typedef IDMap<base::WeakPtr<PPB_Broker_Impl> > PermissionRequestMap;
   PermissionRequestMap pending_permission_requests_;
 
   // Whether or not the focus is on a PPAPI plugin
-  webkit::ppapi::PluginInstanceImpl* focused_plugin_;
+  PepperPluginInstanceImpl* focused_plugin_;
 
   // Current text input composition text. Empty if no composition is in
   // progress.
@@ -445,7 +421,7 @@
   // if the last mouse event went to elements other than Pepper plugins.
   // |last_mouse_event_target_| is not owned by this class. We can know about
   // when it is destroyed via InstanceDeleted().
-  webkit::ppapi::PluginInstanceImpl* last_mouse_event_target_;
+  PepperPluginInstanceImpl* last_mouse_event_target_;
 
   scoped_ptr<GamepadSharedMemoryReader> gamepad_shared_memory_reader_;
 
diff --git a/content/renderer/pepper/ppapi_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
similarity index 82%
rename from content/renderer/pepper/ppapi_plugin_instance_impl.cc
rename to content/renderer/pepper/pepper_plugin_instance_impl.cc
index 229c31e..da6467a 100644
--- a/content/renderer/pepper/ppapi_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 
 #include "base/bind.h"
 #include "base/callback_helpers.h"
@@ -16,6 +16,7 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/time/time.h"
 #include "cc/layers/texture_layer.h"
+#include "content/public/common/page_zoom.h"
 #include "content/renderer/pepper/common.h"
 #include "content/renderer/pepper/content_decryptor_delegate.h"
 #include "content/renderer/pepper/event_conversion.h"
@@ -150,8 +151,7 @@
 using WebKit::WebUserGestureToken;
 using WebKit::WebView;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 #if defined(OS_WIN)
 // Exported by pdf.dll
@@ -293,7 +293,8 @@
 // unchanged.
 bool SecurityOriginForInstance(PP_Instance instance_id,
                                WebKit::WebSecurityOrigin* security_origin) {
-  PluginInstanceImpl* instance = HostGlobals::Get()->GetInstance(instance_id);
+  PepperPluginInstanceImpl* instance =
+      HostGlobals::Get()->GetInstance(instance_id);
   if (!instance)
     return false;
 
@@ -316,29 +317,31 @@
 }  // namespace
 
 // static
-PluginInstanceImpl* PluginInstanceImpl::Create(PluginDelegate* delegate,
-                                               content::RenderView* render_view,
-                                               PluginModule* module,
-                                               WebPluginContainer* container,
-                                               const GURL& plugin_url) {
+PepperPluginInstanceImpl* PepperPluginInstanceImpl::Create(
+    PluginDelegate* delegate,
+    RenderView* render_view,
+    PluginModule* module,
+    WebPluginContainer* container,
+    const GURL& plugin_url) {
   base::Callback<const void*(const char*)> get_plugin_interface_func =
       base::Bind(&PluginModule::GetPluginInterface, module);
   PPP_Instance_Combined* ppp_instance_combined =
       PPP_Instance_Combined::Create(get_plugin_interface_func);
   if (!ppp_instance_combined)
     return NULL;
-  return new PluginInstanceImpl(delegate, render_view, module,
-                                ppp_instance_combined, container, plugin_url);
+  return new PepperPluginInstanceImpl(delegate, render_view, module,
+                                      ppp_instance_combined, container,
+                                      plugin_url);
 }
 
-PluginInstanceImpl::NaClDocumentLoader::NaClDocumentLoader()
+PepperPluginInstanceImpl::NaClDocumentLoader::NaClDocumentLoader()
     : finished_loading_(false) {
 }
 
-PluginInstanceImpl::NaClDocumentLoader::~NaClDocumentLoader(){
+PepperPluginInstanceImpl::NaClDocumentLoader::~NaClDocumentLoader(){
 }
 
-void PluginInstanceImpl::NaClDocumentLoader::ReplayReceivedData(
+void PepperPluginInstanceImpl::NaClDocumentLoader::ReplayReceivedData(
     WebURLLoaderClient* document_loader) {
   for (std::list<std::string>::iterator it = data_.begin();
        it != data_.end(); ++it) {
@@ -354,7 +357,7 @@
   }
 }
 
-void PluginInstanceImpl::NaClDocumentLoader::didReceiveData(
+void PepperPluginInstanceImpl::NaClDocumentLoader::didReceiveData(
     WebURLLoader* loader,
     const char* data,
     int data_length,
@@ -362,43 +365,44 @@
   data_.push_back(std::string(data, data_length));
 }
 
-void PluginInstanceImpl::NaClDocumentLoader::didFinishLoading(
+void PepperPluginInstanceImpl::NaClDocumentLoader::didFinishLoading(
     WebURLLoader* loader,
     double finish_time) {
   DCHECK(!finished_loading_);
   finished_loading_ = true;
 }
 
-void PluginInstanceImpl::NaClDocumentLoader::didFail(
+void PepperPluginInstanceImpl::NaClDocumentLoader::didFail(
     WebURLLoader* loader,
     const WebURLError& error) {
   DCHECK(!error_.get());
   error_.reset(new WebURLError(error));
 }
 
-PluginInstanceImpl::GamepadImpl::GamepadImpl(PluginDelegate* delegate)
+PepperPluginInstanceImpl::GamepadImpl::GamepadImpl(PluginDelegate* delegate)
     : Resource(::ppapi::Resource::Untracked()),
       delegate_(delegate) {
 }
 
-PluginInstanceImpl::GamepadImpl::~GamepadImpl() {
+PepperPluginInstanceImpl::GamepadImpl::~GamepadImpl() {
 }
 
-PPB_Gamepad_API* PluginInstanceImpl::GamepadImpl::AsPPB_Gamepad_API() {
+PPB_Gamepad_API* PepperPluginInstanceImpl::GamepadImpl::AsPPB_Gamepad_API() {
   return this;
 }
 
-void PluginInstanceImpl::GamepadImpl::Sample(PP_Instance instance,
-                                             PP_GamepadsSampleData* data) {
+void PepperPluginInstanceImpl::GamepadImpl::Sample(
+    PP_Instance instance,
+    PP_GamepadsSampleData* data) {
   WebKit::WebGamepads webkit_data;
   delegate_->SampleGamepads(&webkit_data);
   ConvertWebKitGamepadData(
       *reinterpret_cast<const ::ppapi::WebKitGamepads*>(&webkit_data), data);
 }
 
-PluginInstanceImpl::PluginInstanceImpl(
+PepperPluginInstanceImpl::PepperPluginInstanceImpl(
     PluginDelegate* delegate,
-    content::RenderView* render_view,
+    RenderView* render_view,
     PluginModule* module,
     ::ppapi::PPP_Instance_Combined* instance_interface,
     WebPluginContainer* container,
@@ -468,7 +472,7 @@
     nacl_document_load_ = true;
 }
 
-PluginInstanceImpl::~PluginInstanceImpl() {
+PepperPluginInstanceImpl::~PepperPluginInstanceImpl() {
   DCHECK(!fullscreen_container_);
 
   // Force-unbind any Graphics. In the case of Graphics2D, if the plugin
@@ -503,13 +507,13 @@
 
 // NOTE: Any of these methods that calls into the plugin needs to take into
 // account that the plugin may use Var to remove the <embed> from the DOM, which
-// will make the WebPluginImpl drop its reference, usually the last one. If a
-// method needs to access a member of the instance after the call has returned,
-// then it needs to keep its own reference on the stack.
+// will make the PepperWebPluginImpl drop its reference, usually the last one.
+// If a method needs to access a member of the instance after the call has
+// returned, then it needs to keep its own reference on the stack.
 
-void PluginInstanceImpl::Delete() {
+void PepperPluginInstanceImpl::Delete() {
   // Keep a reference on the stack. See NOTE above.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
   // Force the MessageChannel to release its "passthrough object" which should
   // release our last reference to the "InstanceObject" and will probably
   // destroy it. We want to do this prior to calling DidDestroy in case the
@@ -535,9 +539,9 @@
   container_ = NULL;
 }
 
-void PluginInstanceImpl::Paint(WebCanvas* canvas,
-                               const gfx::Rect& plugin_rect,
-                               const gfx::Rect& paint_rect) {
+void PepperPluginInstanceImpl::Paint(WebCanvas* canvas,
+                                     const gfx::Rect& plugin_rect,
+                                     const gfx::Rect& paint_rect) {
   TRACE_EVENT0("ppapi", "PluginInstance::Paint");
   if (module()->is_crashed()) {
     // Crashed plugin painting.
@@ -553,7 +557,7 @@
     bound_graphics_2d->Paint(canvas, plugin_rect, paint_rect);
 }
 
-void PluginInstanceImpl::InvalidateRect(const gfx::Rect& rect) {
+void PepperPluginInstanceImpl::InvalidateRect(const gfx::Rect& rect) {
   if (fullscreen_container_) {
     if (rect.IsEmpty())
       fullscreen_container_->Invalidate();
@@ -570,7 +574,9 @@
   }
 }
 
-void PluginInstanceImpl::ScrollRect(int dx, int dy, const gfx::Rect& rect) {
+void PepperPluginInstanceImpl::ScrollRect(int dx,
+                                          int dy,
+                                          const gfx::Rect& rect) {
   if (fullscreen_container_) {
     fullscreen_container_->ScrollRect(dx, dy, rect);
   } else {
@@ -585,12 +591,12 @@
   }
 }
 
-void PluginInstanceImpl::CommitBackingTexture() {
+void PepperPluginInstanceImpl::CommitBackingTexture() {
   if (texture_layer_.get())
     texture_layer_->SetNeedsDisplay();
 }
 
-void PluginInstanceImpl::InstanceCrashed() {
+void PepperPluginInstanceImpl::InstanceCrashed() {
   // Force free all resources and vars.
   HostGlobals::Get()->InstanceCrashed(pp_instance());
 
@@ -635,9 +641,10 @@
 #endif
 }
 
-bool PluginInstanceImpl::Initialize(const std::vector<std::string>& arg_names,
-                                    const std::vector<std::string>& arg_values,
-                                    bool full_frame) {
+bool PepperPluginInstanceImpl::Initialize(
+    const std::vector<std::string>& arg_names,
+    const std::vector<std::string>& arg_values,
+    bool full_frame) {
   message_channel_.reset(new MessageChannel(this));
 
   full_frame_ = full_frame;
@@ -660,7 +667,7 @@
   return success;
 }
 
-bool PluginInstanceImpl::HandleDocumentLoad(
+bool PepperPluginInstanceImpl::HandleDocumentLoad(
     const WebKit::WebURLResponse& response) {
   DCHECK(!document_loader_);
   if (!nacl_document_load_) {
@@ -683,7 +690,7 @@
   return true;
 }
 
-bool PluginInstanceImpl::SendCompositionEventToPlugin(
+bool PepperPluginInstanceImpl::SendCompositionEventToPlugin(
     PP_InputEvent_Type type, const base::string16& text) {
   std::vector<WebKit::WebCompositionUnderline> empty;
   return SendCompositionEventWithUnderlineInformationToPlugin(
@@ -691,14 +698,15 @@
       static_cast<int>(text.size()));
 }
 
-bool PluginInstanceImpl::SendCompositionEventWithUnderlineInformationToPlugin(
-    PP_InputEvent_Type type,
-    const base::string16& text,
-    const std::vector<WebKit::WebCompositionUnderline>& underlines,
-    int selection_start,
-    int selection_end) {
+bool PepperPluginInstanceImpl::
+    SendCompositionEventWithUnderlineInformationToPlugin(
+        PP_InputEvent_Type type,
+        const base::string16& text,
+        const std::vector<WebKit::WebCompositionUnderline>& underlines,
+        int selection_start,
+        int selection_end) {
   // Keep a reference on the stack. See NOTE above.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
 
   if (!LoadInputEventInterface())
     return false;
@@ -767,19 +775,21 @@
   return handled;
 }
 
-void PluginInstanceImpl::RequestInputEventsHelper(uint32_t event_classes) {
+void PepperPluginInstanceImpl::RequestInputEventsHelper(
+    uint32_t event_classes) {
   if (event_classes & PP_INPUTEVENT_CLASS_TOUCH)
     UpdateTouchEventRequest();
   if (event_classes & PP_INPUTEVENT_CLASS_WHEEL)
     container_->setWantsWheelEvents(IsAcceptingWheelEvents());
 }
 
-bool PluginInstanceImpl::HandleCompositionStart(const base::string16& text) {
+bool PepperPluginInstanceImpl::HandleCompositionStart(
+    const base::string16& text) {
   return SendCompositionEventToPlugin(PP_INPUTEVENT_TYPE_IME_COMPOSITION_START,
                                       text);
 }
 
-bool PluginInstanceImpl::HandleCompositionUpdate(
+bool PepperPluginInstanceImpl::HandleCompositionUpdate(
     const base::string16& text,
     const std::vector<WebKit::WebCompositionUnderline>& underlines,
     int selection_start,
@@ -789,18 +799,19 @@
       text, underlines, selection_start, selection_end);
 }
 
-bool PluginInstanceImpl::HandleCompositionEnd(const base::string16& text) {
+bool PepperPluginInstanceImpl::HandleCompositionEnd(
+    const base::string16& text) {
   return SendCompositionEventToPlugin(PP_INPUTEVENT_TYPE_IME_COMPOSITION_END,
                                       text);
 }
 
-bool PluginInstanceImpl::HandleTextInput(const base::string16& text) {
+bool PepperPluginInstanceImpl::HandleTextInput(const base::string16& text) {
   return SendCompositionEventToPlugin(PP_INPUTEVENT_TYPE_IME_TEXT,
                                       text);
 }
 
-void PluginInstanceImpl::GetSurroundingText(base::string16* text,
-                                            ui::Range* range) const {
+void PepperPluginInstanceImpl::GetSurroundingText(base::string16* text,
+                                                  ui::Range* range) const {
   std::vector<size_t> offsets;
   offsets.push_back(selection_anchor_);
   offsets.push_back(selection_caret_);
@@ -811,12 +822,12 @@
                                                     : offsets[1]);
 }
 
-bool PluginInstanceImpl::IsPluginAcceptingCompositionEvents() const {
+bool PepperPluginInstanceImpl::IsPluginAcceptingCompositionEvents() const {
   return (filtered_input_event_mask_ & PP_INPUTEVENT_CLASS_IME) ||
       (input_event_mask_ & PP_INPUTEVENT_CLASS_IME);
 }
 
-gfx::Rect PluginInstanceImpl::GetCaretBounds() const {
+gfx::Rect PepperPluginInstanceImpl::GetCaretBounds() const {
   if (!text_input_caret_set_) {
     // If it is never set by the plugin, use the bottom left corner.
     return gfx::Rect(view_data_.rect.point.x,
@@ -834,9 +845,10 @@
   return caret;
 }
 
-bool PluginInstanceImpl::HandleInputEvent(const WebKit::WebInputEvent& event,
-                                          WebCursorInfo* cursor_info) {
-  TRACE_EVENT0("ppapi", "PluginInstanceImpl::HandleInputEvent");
+bool PepperPluginInstanceImpl::HandleInputEvent(
+    const WebKit::WebInputEvent& event,
+    WebCursorInfo* cursor_info) {
+  TRACE_EVENT0("ppapi", "PepperPluginInstanceImpl::HandleInputEvent");
 
   if (WebInputEvent::isMouseEventType(event.type))
     delegate()->DidReceiveMouseEvent(this);
@@ -846,7 +858,7 @@
     return false;
 
   // Keep a reference on the stack. See NOTE above.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
 
   bool rv = false;
   if (LoadInputEventInterface()) {
@@ -892,18 +904,18 @@
   return rv;
 }
 
-void PluginInstanceImpl::HandleMessage(PP_Var message) {
-  TRACE_EVENT0("ppapi", "PluginInstanceImpl::HandleMessage");
+void PepperPluginInstanceImpl::HandleMessage(PP_Var message) {
+  TRACE_EVENT0("ppapi", "PepperPluginInstanceImpl::HandleMessage");
   // Keep a reference on the stack. See NOTE above.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
   if (!LoadMessagingInterface())
     return;
   plugin_messaging_interface_->HandleMessage(pp_instance(), message);
 }
 
-PP_Var PluginInstanceImpl::GetInstanceObject() {
+PP_Var PepperPluginInstanceImpl::GetInstanceObject() {
   // Keep a reference on the stack. See NOTE above.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
 
   // If the plugin supports the private instance interface, try to retrieve its
   // instance object.
@@ -912,7 +924,7 @@
   return PP_MakeUndefined();
 }
 
-void PluginInstanceImpl::ViewChanged(
+void PepperPluginInstanceImpl::ViewChanged(
     const gfx::Rect& position,
     const gfx::Rect& clip,
     const std::vector<gfx::Rect>& cut_outs_rects) {
@@ -965,7 +977,7 @@
   SendDidChangeView();
 }
 
-void PluginInstanceImpl::SetWebKitFocus(bool has_focus) {
+void PepperPluginInstanceImpl::SetWebKitFocus(bool has_focus) {
   if (has_webkit_focus_ == has_focus)
     return;
 
@@ -975,7 +987,7 @@
     SendFocusChangeNotification();
 }
 
-void PluginInstanceImpl::SetContentAreaFocus(bool has_focus) {
+void PepperPluginInstanceImpl::SetContentAreaFocus(bool has_focus) {
   if (has_content_area_focus_ == has_focus)
     return;
 
@@ -985,44 +997,44 @@
     SendFocusChangeNotification();
 }
 
-void PluginInstanceImpl::PageVisibilityChanged(bool is_visible) {
+void PepperPluginInstanceImpl::PageVisibilityChanged(bool is_visible) {
   if (is_visible == view_data_.is_page_visible)
     return;  // Nothing to do.
   view_data_.is_page_visible = is_visible;
 
   // If the initial DidChangeView notification hasn't been sent to the plugin,
   // let it pass the visibility state for us, instead of sending a notification
-  // immediately. It is possible that PluginInstanceImpl::ViewChanged() hasn't
-  // been called for the first time. In that case, most of the fields in
+  // immediately. It is possible that PepperPluginInstanceImpl::ViewChanged()
+  // hasn't been called for the first time. In that case, most of the fields in
   // |view_data_| haven't been properly initialized.
   if (sent_initial_did_change_view_)
     SendDidChangeView();
 }
 
-void PluginInstanceImpl::ViewWillInitiatePaint() {
+void PepperPluginInstanceImpl::ViewWillInitiatePaint() {
   if (GetBoundGraphics2D())
     GetBoundGraphics2D()->ViewWillInitiatePaint();
   else if (bound_graphics_3d_.get())
     bound_graphics_3d_->ViewWillInitiatePaint();
 }
 
-void PluginInstanceImpl::ViewInitiatedPaint() {
+void PepperPluginInstanceImpl::ViewInitiatedPaint() {
   if (GetBoundGraphics2D())
     GetBoundGraphics2D()->ViewInitiatedPaint();
   else if (bound_graphics_3d_.get())
     bound_graphics_3d_->ViewInitiatedPaint();
 }
 
-void PluginInstanceImpl::ViewFlushedPaint() {
+void PepperPluginInstanceImpl::ViewFlushedPaint() {
   // Keep a reference on the stack. See NOTE above.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
   if (GetBoundGraphics2D())
     GetBoundGraphics2D()->ViewFlushedPaint();
   else if (bound_graphics_3d_.get())
     bound_graphics_3d_->ViewFlushedPaint();
 }
 
-bool PluginInstanceImpl::GetBitmapForOptimizedPluginPaint(
+bool PepperPluginInstanceImpl::GetBitmapForOptimizedPluginPaint(
     const gfx::Rect& paint_bounds,
     TransportDIB** dib,
     gfx::Rect* location,
@@ -1079,9 +1091,9 @@
   return true;
 }
 
-base::string16 PluginInstanceImpl::GetSelectedText(bool html) {
+base::string16 PepperPluginInstanceImpl::GetSelectedText(bool html) {
   // Keep a reference on the stack. See NOTE above.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
   if (!LoadSelectionInterface())
     return base::string16();
 
@@ -1096,9 +1108,10 @@
   return selection;
 }
 
-base::string16 PluginInstanceImpl::GetLinkAtPosition(const gfx::Point& point) {
+base::string16 PepperPluginInstanceImpl::GetLinkAtPosition(
+    const gfx::Point& point) {
   // Keep a reference on the stack. See NOTE above.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
   if (!LoadPdfInterface())
     return base::string16();
 
@@ -1115,29 +1128,29 @@
   return link;
 }
 
-void PluginInstanceImpl::RequestSurroundingText(
+void PepperPluginInstanceImpl::RequestSurroundingText(
     size_t desired_number_of_characters) {
   // Keep a reference on the stack. See NOTE above.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
   if (!LoadTextInputInterface())
     return;
   plugin_textinput_interface_->RequestSurroundingText(
       pp_instance(), desired_number_of_characters);
 }
 
-void PluginInstanceImpl::Zoom(double factor, bool text_only) {
+void PepperPluginInstanceImpl::Zoom(double factor, bool text_only) {
   // Keep a reference on the stack. See NOTE above.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
   if (!LoadZoomInterface())
     return;
   plugin_zoom_interface_->Zoom(pp_instance(), factor, PP_FromBool(text_only));
 }
 
-bool PluginInstanceImpl::StartFind(const base::string16& search_text,
-                                   bool case_sensitive,
-                                   int identifier) {
+bool PepperPluginInstanceImpl::StartFind(const base::string16& search_text,
+                                         bool case_sensitive,
+                                         int identifier) {
   // Keep a reference on the stack. See NOTE above.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
   if (!LoadFindInterface())
     return false;
   find_identifier_ = identifier;
@@ -1148,24 +1161,24 @@
           PP_FromBool(case_sensitive)));
 }
 
-void PluginInstanceImpl::SelectFindResult(bool forward) {
+void PepperPluginInstanceImpl::SelectFindResult(bool forward) {
   // Keep a reference on the stack. See NOTE above.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
   if (LoadFindInterface())
     plugin_find_interface_->SelectFindResult(pp_instance(),
                                              PP_FromBool(forward));
 }
 
-void PluginInstanceImpl::StopFind() {
+void PepperPluginInstanceImpl::StopFind() {
   // Keep a reference on the stack. See NOTE above.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
   if (!LoadFindInterface())
     return;
   find_identifier_ = -1;
   plugin_find_interface_->StopFind(pp_instance());
 }
 
-bool PluginInstanceImpl::LoadFindInterface() {
+bool PepperPluginInstanceImpl::LoadFindInterface() {
   if (!plugin_find_interface_) {
     plugin_find_interface_ =
         static_cast<const PPP_Find_Dev*>(module_->GetPluginInterface(
@@ -1175,7 +1188,7 @@
   return !!plugin_find_interface_;
 }
 
-bool PluginInstanceImpl::LoadInputEventInterface() {
+bool PepperPluginInstanceImpl::LoadInputEventInterface() {
   if (!checked_for_plugin_input_event_interface_) {
     checked_for_plugin_input_event_interface_ = true;
     plugin_input_event_interface_ =
@@ -1185,7 +1198,7 @@
   return !!plugin_input_event_interface_;
 }
 
-bool PluginInstanceImpl::LoadMessagingInterface() {
+bool PepperPluginInstanceImpl::LoadMessagingInterface() {
   if (!checked_for_plugin_messaging_interface_) {
     checked_for_plugin_messaging_interface_ = true;
     plugin_messaging_interface_ =
@@ -1195,7 +1208,7 @@
   return !!plugin_messaging_interface_;
 }
 
-bool PluginInstanceImpl::LoadMouseLockInterface() {
+bool PepperPluginInstanceImpl::LoadMouseLockInterface() {
   if (!plugin_mouse_lock_interface_) {
     plugin_mouse_lock_interface_ =
         static_cast<const PPP_MouseLock*>(module_->GetPluginInterface(
@@ -1205,7 +1218,7 @@
   return !!plugin_mouse_lock_interface_;
 }
 
-bool PluginInstanceImpl::LoadPdfInterface() {
+bool PepperPluginInstanceImpl::LoadPdfInterface() {
   if (!checked_for_plugin_pdf_interface_) {
     checked_for_plugin_pdf_interface_ = true;
     plugin_pdf_interface_ =
@@ -1216,7 +1229,7 @@
   return !!plugin_pdf_interface_;
 }
 
-bool PluginInstanceImpl::LoadPrintInterface() {
+bool PepperPluginInstanceImpl::LoadPrintInterface() {
   // Only check for the interface if the plugin has dev permission.
   if (!module_->permissions().HasPermission(::ppapi::PERMISSION_DEV))
     return false;
@@ -1227,7 +1240,7 @@
   return !!plugin_print_interface_;
 }
 
-bool PluginInstanceImpl::LoadPrivateInterface() {
+bool PepperPluginInstanceImpl::LoadPrivateInterface() {
   // Only check for the interface if the plugin has private permission.
   if (!module_->permissions().HasPermission(::ppapi::PERMISSION_PRIVATE))
     return false;
@@ -1239,7 +1252,7 @@
   return !!plugin_private_interface_;
 }
 
-bool PluginInstanceImpl::LoadSelectionInterface() {
+bool PepperPluginInstanceImpl::LoadSelectionInterface() {
   if (!plugin_selection_interface_) {
     plugin_selection_interface_ =
         static_cast<const PPP_Selection_Dev*>(module_->GetPluginInterface(
@@ -1248,7 +1261,7 @@
   return !!plugin_selection_interface_;
 }
 
-bool PluginInstanceImpl::LoadTextInputInterface() {
+bool PepperPluginInstanceImpl::LoadTextInputInterface() {
   if (!plugin_textinput_interface_) {
     plugin_textinput_interface_ =
         static_cast<const PPP_TextInput_Dev*>(module_->GetPluginInterface(
@@ -1258,7 +1271,7 @@
   return !!plugin_textinput_interface_;
 }
 
-bool PluginInstanceImpl::LoadZoomInterface() {
+bool PepperPluginInstanceImpl::LoadZoomInterface() {
   if (!plugin_zoom_interface_) {
     plugin_zoom_interface_ =
         static_cast<const PPP_Zoom_Dev*>(module_->GetPluginInterface(
@@ -1268,13 +1281,13 @@
   return !!plugin_zoom_interface_;
 }
 
-bool PluginInstanceImpl::PluginHasFocus() const {
+bool PepperPluginInstanceImpl::PluginHasFocus() const {
   return flash_fullscreen_ || (has_webkit_focus_ && has_content_area_focus_);
 }
 
-void PluginInstanceImpl::SendFocusChangeNotification() {
-  // This call can happen during PluginInstanceImpl destruction, because WebKit
-  // informs the plugin it's losing focus. See crbug.com/236574
+void PepperPluginInstanceImpl::SendFocusChangeNotification() {
+  // This call can happen during PepperPluginInstanceImpl destruction, because
+  // WebKit informs the plugin it's losing focus. See crbug.com/236574
   if (!delegate_ || !instance_interface_)
     return;
   bool has_focus = PluginHasFocus();
@@ -1282,7 +1295,7 @@
   instance_interface_->DidChangeFocus(pp_instance(), PP_FromBool(has_focus));
 }
 
-void PluginInstanceImpl::UpdateTouchEventRequest() {
+void PepperPluginInstanceImpl::UpdateTouchEventRequest() {
   bool raw_touch = (filtered_input_event_mask_ & PP_INPUTEVENT_CLASS_TOUCH) ||
                    (input_event_mask_ & PP_INPUTEVENT_CLASS_TOUCH);
   container_->requestTouchEventType(raw_touch ?
@@ -1290,21 +1303,21 @@
       WebKit::WebPluginContainer::TouchEventRequestTypeSynthesizedMouse);
 }
 
-bool PluginInstanceImpl::IsAcceptingWheelEvents() const {
+bool PepperPluginInstanceImpl::IsAcceptingWheelEvents() const {
   return (filtered_input_event_mask_ & PP_INPUTEVENT_CLASS_WHEEL) ||
       (input_event_mask_ & PP_INPUTEVENT_CLASS_WHEEL);
 }
 
-void PluginInstanceImpl::ScheduleAsyncDidChangeView() {
+void PepperPluginInstanceImpl::ScheduleAsyncDidChangeView() {
   if (view_change_weak_ptr_factory_.HasWeakPtrs())
     return;  // Already scheduled.
   base::MessageLoop::current()->PostTask(
       FROM_HERE,
-      base::Bind(&PluginInstanceImpl::SendAsyncDidChangeView,
+      base::Bind(&PepperPluginInstanceImpl::SendAsyncDidChangeView,
                  view_change_weak_ptr_factory_.GetWeakPtr()));
 }
 
-void PluginInstanceImpl::SendAsyncDidChangeView() {
+void PepperPluginInstanceImpl::SendAsyncDidChangeView() {
   // The bound callback that owns the weak pointer is still valid until after
   // this function returns. SendDidChangeView checks HasWeakPtrs, so we need to
   // invalidate them here.
@@ -1314,7 +1327,7 @@
   SendDidChangeView();
 }
 
-void PluginInstanceImpl::SendDidChangeView() {
+void PepperPluginInstanceImpl::SendDidChangeView() {
   // Don't send DidChangeView to crashed plugins.
   if (module()->is_crashed())
     return;
@@ -1346,7 +1359,7 @@
                                      &view_data_.clip_rect);
 }
 
-void PluginInstanceImpl::ReportGeometry() {
+void PepperPluginInstanceImpl::ReportGeometry() {
   // If this call was delayed, we may have transitioned back to fullscreen in
   // the mean time, so only report the geometry if we are actually in normal
   // mode.
@@ -1354,10 +1367,10 @@
     container_->reportGeometry();
 }
 
-bool PluginInstanceImpl::GetPreferredPrintOutputFormat(
+bool PepperPluginInstanceImpl::GetPreferredPrintOutputFormat(
     PP_PrintOutputFormat_Dev* format) {
   // Keep a reference on the stack. See NOTE above.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
   if (!LoadPrintInterface())
     return false;
   uint32_t supported_formats =
@@ -1369,21 +1382,21 @@
   return false;
 }
 
-bool PluginInstanceImpl::SupportsPrintInterface() {
+bool PepperPluginInstanceImpl::SupportsPrintInterface() {
   PP_PrintOutputFormat_Dev format;
   return GetPreferredPrintOutputFormat(&format);
 }
 
-bool PluginInstanceImpl::IsPrintScalingDisabled() {
+bool PepperPluginInstanceImpl::IsPrintScalingDisabled() {
   DCHECK(plugin_print_interface_);
   if (!plugin_print_interface_)
     return false;
   return plugin_print_interface_->IsScalingDisabled(pp_instance()) == PP_TRUE;
 }
 
-int PluginInstanceImpl::PrintBegin(const WebPrintParams& print_params) {
+int PepperPluginInstanceImpl::PrintBegin(const WebPrintParams& print_params) {
   // Keep a reference on the stack. See NOTE above.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
   PP_PrintOutputFormat_Dev format;
   if (!GetPreferredPrintOutputFormat(&format)) {
     // PrintBegin should not have been called since SupportsPrintInterface
@@ -1412,7 +1425,8 @@
   return num_pages;
 }
 
-bool PluginInstanceImpl::PrintPage(int page_number, WebKit::WebCanvas* canvas) {
+bool PepperPluginInstanceImpl::PrintPage(int page_number,
+                                         WebKit::WebCanvas* canvas) {
 #if defined(ENABLE_PRINTING)
   DCHECK(plugin_print_interface_);
   PP_PrintPageNumberRange_Dev page_range;
@@ -1435,12 +1449,12 @@
 #endif
 }
 
-bool PluginInstanceImpl::PrintPageHelper(
+bool PepperPluginInstanceImpl::PrintPageHelper(
     PP_PrintPageNumberRange_Dev* page_ranges,
     int num_ranges,
     WebKit::WebCanvas* canvas) {
   // Keep a reference on the stack. See NOTE above.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
   DCHECK(plugin_print_interface_);
   if (!plugin_print_interface_)
     return false;
@@ -1460,9 +1474,9 @@
   return ret;
 }
 
-void PluginInstanceImpl::PrintEnd() {
+void PepperPluginInstanceImpl::PrintEnd() {
   // Keep a reference on the stack. See NOTE above.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
   if (!ranges_.empty())
     PrintPageHelper(&(ranges_.front()), ranges_.size(), canvas_.get());
   canvas_.clear();
@@ -1478,14 +1492,14 @@
 #endif  // defined(OS_MACOSX)
 }
 
-bool PluginInstanceImpl::CanRotateView() {
+bool PepperPluginInstanceImpl::CanRotateView() {
   if (!LoadPdfInterface())
     return false;
 
   return true;
 }
 
-void PluginInstanceImpl::SetBoundGraphics2DForTest(
+void PepperPluginInstanceImpl::SetBoundGraphics2DForTest(
     PluginDelegate::PlatformGraphics2D* graphics) {
   BindGraphics(pp_instance(), 0);  // Unbind any old stuff.
   if (graphics) {
@@ -1494,7 +1508,7 @@
   }
 }
 
-void PluginInstanceImpl::RotateView(WebPlugin::RotationType type) {
+void PepperPluginInstanceImpl::RotateView(WebPlugin::RotationType type) {
   if (!LoadPdfInterface())
     return;
   PP_PrivatePageTransformType transform_type =
@@ -1505,17 +1519,17 @@
   // NOTE: plugin instance may have been deleted.
 }
 
-bool PluginInstanceImpl::FlashIsFullscreenOrPending() {
+bool PepperPluginInstanceImpl::FlashIsFullscreenOrPending() {
   return fullscreen_container_ != NULL;
 }
 
-bool PluginInstanceImpl::IsFullscreenOrPending() {
+bool PepperPluginInstanceImpl::IsFullscreenOrPending() {
   return desired_fullscreen_state_;
 }
 
-bool PluginInstanceImpl::SetFullscreen(bool fullscreen) {
+bool PepperPluginInstanceImpl::SetFullscreen(bool fullscreen) {
   // Keep a reference on the stack. See NOTE above.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
 
   // Check whether we are trying to switch to the state we're already going
   // to (i.e. if we're already switching to fullscreen but the fullscreen
@@ -1549,7 +1563,8 @@
   return true;
 }
 
-void PluginInstanceImpl::UpdateFlashFullscreenState(bool flash_fullscreen) {
+void PepperPluginInstanceImpl::UpdateFlashFullscreenState(
+    bool flash_fullscreen) {
   bool is_mouselock_pending = TrackedCallback::IsPending(lock_mouse_callback_);
 
   if (flash_fullscreen == flash_fullscreen_) {
@@ -1583,7 +1598,7 @@
     SendFocusChangeNotification();
 }
 
-bool PluginInstanceImpl::IsViewAccelerated() {
+bool PepperPluginInstanceImpl::IsViewAccelerated() {
   if (!container_)
     return false;
 
@@ -1598,12 +1613,12 @@
   return view->isAcceleratedCompositingActive();
 }
 
-PluginDelegate::PlatformContext3D* PluginInstanceImpl::CreateContext3D() {
+PluginDelegate::PlatformContext3D* PepperPluginInstanceImpl::CreateContext3D() {
   return delegate_->CreateContext3D();
 }
 
-bool PluginInstanceImpl::PrintPDFOutput(PP_Resource print_output,
-                                        WebKit::WebCanvas* canvas) {
+bool PepperPluginInstanceImpl::PrintPDFOutput(PP_Resource print_output,
+                                              WebKit::WebCanvas* canvas) {
 #if defined(ENABLE_PRINTING)
   ::ppapi::thunk::EnterResourceNoLock<PPB_Buffer_API> enter(print_output, true);
   if (enter.failed())
@@ -1695,13 +1710,13 @@
 }
 
 PluginDelegate::PlatformGraphics2D*
-    PluginInstanceImpl::GetBoundGraphics2D() const {
+    PepperPluginInstanceImpl::GetBoundGraphics2D() const {
   return bound_graphics_2d_platform_;
 }
 
 static void IgnoreCallback(unsigned, bool) {}
 
-void PluginInstanceImpl::UpdateLayer() {
+void PepperPluginInstanceImpl::UpdateLayer() {
   if (!container_)
     return;
 
@@ -1745,19 +1760,19 @@
   layer_bound_to_fullscreen_ = !!fullscreen_container_;
 }
 
-void PluginInstanceImpl::AddPluginObject(PluginObject* plugin_object) {
+void PepperPluginInstanceImpl::AddPluginObject(PluginObject* plugin_object) {
   DCHECK(live_plugin_objects_.find(plugin_object) ==
          live_plugin_objects_.end());
   live_plugin_objects_.insert(plugin_object);
 }
 
-void PluginInstanceImpl::RemovePluginObject(PluginObject* plugin_object) {
+void PepperPluginInstanceImpl::RemovePluginObject(PluginObject* plugin_object) {
   // Don't actually verify that the object is in the set since during module
   // deletion we'll be in the process of freeing them.
   live_plugin_objects_.erase(plugin_object);
 }
 
-bool PluginInstanceImpl::IsProcessingUserGesture() {
+bool PepperPluginInstanceImpl::IsProcessingUserGesture() {
   PP_TimeTicks now =
       ::ppapi::TimeTicksToPPTimeTicks(base::TimeTicks::Now());
   // Give a lot of slack so tests won't be flaky.
@@ -1766,30 +1781,31 @@
          (now - pending_user_gesture_ < kUserGestureDurationInSeconds);
 }
 
-WebUserGestureToken PluginInstanceImpl::CurrentUserGestureToken() {
+WebUserGestureToken PepperPluginInstanceImpl::CurrentUserGestureToken() {
   if (!IsProcessingUserGesture())
     pending_user_gesture_token_ = WebUserGestureToken();
   return pending_user_gesture_token_;
 }
 
-void PluginInstanceImpl::OnLockMouseACK(bool succeeded) {
+void PepperPluginInstanceImpl::OnLockMouseACK(bool succeeded) {
   if (TrackedCallback::IsPending(lock_mouse_callback_))
     lock_mouse_callback_->Run(succeeded ? PP_OK : PP_ERROR_FAILED);
 }
 
-void PluginInstanceImpl::OnMouseLockLost() {
+void PepperPluginInstanceImpl::OnMouseLockLost() {
   if (LoadMouseLockInterface())
     plugin_mouse_lock_interface_->MouseLockLost(pp_instance());
 }
 
-void PluginInstanceImpl::HandleMouseLockedInputEvent(
+void PepperPluginInstanceImpl::HandleMouseLockedInputEvent(
     const WebKit::WebMouseEvent& event) {
   // |cursor_info| is ignored since it is hidden when the mouse is locked.
   WebKit::WebCursorInfo cursor_info;
   HandleInputEvent(event, &cursor_info);
 }
 
-void PluginInstanceImpl::SimulateInputEvent(const InputEventData& input_event) {
+void PepperPluginInstanceImpl::SimulateInputEvent(
+    const InputEventData& input_event) {
   WebView* web_view = container()->element().document().frame()->view();
   if (!web_view) {
     NOTREACHED();
@@ -1811,7 +1827,8 @@
   }
 }
 
-bool PluginInstanceImpl::SimulateIMEEvent(const InputEventData& input_event) {
+bool PepperPluginInstanceImpl::SimulateIMEEvent(
+    const InputEventData& input_event) {
   switch (input_event.event_type) {
     case PP_INPUTEVENT_TYPE_IME_COMPOSITION_START:
     case PP_INPUTEVENT_TYPE_IME_COMPOSITION_UPDATE:
@@ -1831,7 +1848,7 @@
   return true;
 }
 
-void PluginInstanceImpl::SimulateImeSetCompositionEvent(
+void PepperPluginInstanceImpl::SimulateImeSetCompositionEvent(
     const InputEventData& input_event) {
   std::vector<size_t> offsets;
   offsets.push_back(input_event.composition_selection_start);
@@ -1857,7 +1874,8 @@
       utf16_text, underlines, offsets[0], offsets[1]);
 }
 
-ContentDecryptorDelegate* PluginInstanceImpl::GetContentDecryptorDelegate() {
+ContentDecryptorDelegate*
+    PepperPluginInstanceImpl::GetContentDecryptorDelegate() {
   if (content_decryptor_delegate_)
     return content_decryptor_delegate_.get();
 
@@ -1873,9 +1891,9 @@
   return content_decryptor_delegate_.get();
 }
 
-PP_Bool PluginInstanceImpl::BindGraphics(PP_Instance instance,
-                                         PP_Resource device) {
-  TRACE_EVENT0("ppapi", "PluginInstanceImpl::BindGraphics");
+PP_Bool PepperPluginInstanceImpl::BindGraphics(PP_Instance instance,
+                                               PP_Resource device) {
+  TRACE_EVENT0("ppapi", "PepperPluginInstanceImpl::BindGraphics");
   // The Graphics3D instance can't be destroyed until we call
   // UpdateLayer().
   scoped_refptr< ::ppapi::Resource> old_graphics = bound_graphics_3d_.get();
@@ -1928,19 +1946,19 @@
   return PP_FALSE;
 }
 
-PP_Bool PluginInstanceImpl::IsFullFrame(PP_Instance instance) {
+PP_Bool PepperPluginInstanceImpl::IsFullFrame(PP_Instance instance) {
   return PP_FromBool(full_frame());
 }
 
-const ViewData* PluginInstanceImpl::GetViewData(PP_Instance instance) {
+const ViewData* PepperPluginInstanceImpl::GetViewData(PP_Instance instance) {
   return &view_data_;
 }
 
-PP_Bool PluginInstanceImpl::FlashIsFullscreen(PP_Instance instance) {
+PP_Bool PepperPluginInstanceImpl::FlashIsFullscreen(PP_Instance instance) {
   return PP_FromBool(flash_fullscreen_);
 }
 
-PP_Var PluginInstanceImpl::GetWindowObject(PP_Instance instance) {
+PP_Var PepperPluginInstanceImpl::GetWindowObject(PP_Instance instance) {
   if (!container_)
     return PP_MakeUndefined();
 
@@ -1951,19 +1969,19 @@
   return NPObjectToPPVar(this, frame->windowObject());
 }
 
-PP_Var PluginInstanceImpl::GetOwnerElementObject(PP_Instance instance) {
+PP_Var PepperPluginInstanceImpl::GetOwnerElementObject(PP_Instance instance) {
   if (!container_)
     return PP_MakeUndefined();
   return NPObjectToPPVar(this, container_->scriptableObjectForElement());
 }
 
-PP_Var PluginInstanceImpl::ExecuteScript(PP_Instance instance,
-                                         PP_Var script,
-                                         PP_Var* exception) {
+PP_Var PepperPluginInstanceImpl::ExecuteScript(PP_Instance instance,
+                                               PP_Var script,
+                                               PP_Var* exception) {
   // Executing the script may remove the plugin from the DOM, so we need to keep
   // a reference to ourselves so that we can still process the result after the
   // WebBindings::evaluate() below.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
   TryCatch try_catch(exception);
   if (try_catch.has_exception())
     return PP_MakeUndefined();
@@ -2008,17 +2026,17 @@
   return ret;
 }
 
-uint32_t PluginInstanceImpl::GetAudioHardwareOutputSampleRate(
+uint32_t PepperPluginInstanceImpl::GetAudioHardwareOutputSampleRate(
     PP_Instance instance) {
   return delegate()->GetAudioHardwareOutputSampleRate();
 }
 
-uint32_t PluginInstanceImpl::GetAudioHardwareOutputBufferSize(
+uint32_t PepperPluginInstanceImpl::GetAudioHardwareOutputBufferSize(
     PP_Instance instance) {
   return delegate()->GetAudioHardwareOutputBufferSize();
 }
 
-PP_Var PluginInstanceImpl::GetDefaultCharSet(PP_Instance instance) {
+PP_Var PepperPluginInstanceImpl::GetDefaultCharSet(PP_Instance instance) {
   std::string encoding = delegate()->GetDefaultEncoding();
   return StringVar::StringToPPVar(encoding);
 }
@@ -2027,45 +2045,46 @@
 // PPP_ContentDecryptor_Private calls made on |content_decryptor_delegate_|.
 // Therefore, |content_decryptor_delegate_| must have been initialized when
 // the following methods are called.
-void PluginInstanceImpl::NeedKey(PP_Instance instance,
-                                 PP_Var key_system_var,
-                                 PP_Var session_id_var,
-                                 PP_Var init_data_var) {
+void PepperPluginInstanceImpl::NeedKey(PP_Instance instance,
+                                       PP_Var key_system_var,
+                                       PP_Var session_id_var,
+                                       PP_Var init_data_var) {
   content_decryptor_delegate_->NeedKey(
       key_system_var, session_id_var, init_data_var);
 }
 
-void PluginInstanceImpl::KeyAdded(PP_Instance instance,
-                                  PP_Var key_system_var,
-                                  PP_Var session_id_var) {
+void PepperPluginInstanceImpl::KeyAdded(PP_Instance instance,
+                                        PP_Var key_system_var,
+                                        PP_Var session_id_var) {
   content_decryptor_delegate_->KeyAdded(key_system_var, session_id_var);
 }
 
-void PluginInstanceImpl::KeyMessage(PP_Instance instance,
-                                    PP_Var key_system_var,
-                                    PP_Var session_id_var,
-                                    PP_Var message_var,
-                                    PP_Var default_url_var) {
+void PepperPluginInstanceImpl::KeyMessage(PP_Instance instance,
+                                          PP_Var key_system_var,
+                                          PP_Var session_id_var,
+                                          PP_Var message_var,
+                                          PP_Var default_url_var) {
   content_decryptor_delegate_->KeyMessage(
       key_system_var, session_id_var, message_var, default_url_var);
 }
 
-void PluginInstanceImpl::KeyError(PP_Instance instance,
-                                  PP_Var key_system_var,
-                                  PP_Var session_id_var,
-                                  int32_t media_error,
-                                  int32_t system_code) {
+void PepperPluginInstanceImpl::KeyError(PP_Instance instance,
+                                        PP_Var key_system_var,
+                                        PP_Var session_id_var,
+                                        int32_t media_error,
+                                        int32_t system_code) {
   content_decryptor_delegate_->KeyError(
       key_system_var, session_id_var, media_error, system_code);
 }
 
-void PluginInstanceImpl::DeliverBlock(PP_Instance instance,
-                                      PP_Resource decrypted_block,
-                                      const PP_DecryptedBlockInfo* block_info) {
+void PepperPluginInstanceImpl::DeliverBlock(
+    PP_Instance instance,
+    PP_Resource decrypted_block,
+    const PP_DecryptedBlockInfo* block_info) {
   content_decryptor_delegate_->DeliverBlock(decrypted_block, block_info);
 }
 
-void PluginInstanceImpl::DecoderInitializeDone(
+void PepperPluginInstanceImpl::DecoderInitializeDone(
     PP_Instance instance,
     PP_DecryptorStreamType decoder_type,
     uint32_t request_id,
@@ -2074,7 +2093,7 @@
       decoder_type, request_id, success);
 }
 
-void PluginInstanceImpl::DecoderDeinitializeDone(
+void PepperPluginInstanceImpl::DecoderDeinitializeDone(
     PP_Instance instance,
     PP_DecryptorStreamType decoder_type,
     uint32_t request_id) {
@@ -2082,56 +2101,60 @@
                                                        request_id);
 }
 
-void PluginInstanceImpl::DecoderResetDone(PP_Instance instance,
-                                          PP_DecryptorStreamType decoder_type,
-                                          uint32_t request_id) {
+void PepperPluginInstanceImpl::DecoderResetDone(
+    PP_Instance instance,
+    PP_DecryptorStreamType decoder_type,
+    uint32_t request_id) {
   content_decryptor_delegate_->DecoderResetDone(decoder_type, request_id);
 }
 
 
-void PluginInstanceImpl::DeliverFrame(PP_Instance instance,
-                                      PP_Resource decrypted_frame,
-                                      const PP_DecryptedFrameInfo* frame_info) {
+void PepperPluginInstanceImpl::DeliverFrame(
+    PP_Instance instance,
+    PP_Resource decrypted_frame,
+    const PP_DecryptedFrameInfo* frame_info) {
   content_decryptor_delegate_->DeliverFrame(decrypted_frame, frame_info);
 }
 
-void PluginInstanceImpl::DeliverSamples(
+void PepperPluginInstanceImpl::DeliverSamples(
     PP_Instance instance,
     PP_Resource audio_frames,
     const PP_DecryptedBlockInfo* block_info) {
   content_decryptor_delegate_->DeliverSamples(audio_frames, block_info);
 }
 
-void PluginInstanceImpl::NumberOfFindResultsChanged(PP_Instance instance,
-                                                    int32_t total,
-                                                    PP_Bool final_result) {
+void PepperPluginInstanceImpl::NumberOfFindResultsChanged(
+    PP_Instance instance,
+    int32_t total,
+    PP_Bool final_result) {
   DCHECK_NE(find_identifier_, -1);
   delegate_->NumberOfFindResultsChanged(find_identifier_, total,
                                         PP_ToBool(final_result));
 }
 
-void PluginInstanceImpl::SelectedFindResultChanged(PP_Instance instance,
-                                                   int32_t index) {
+void PepperPluginInstanceImpl::SelectedFindResultChanged(PP_Instance instance,
+                                                         int32_t index) {
   DCHECK_NE(find_identifier_, -1);
   delegate_->SelectedFindResultChanged(find_identifier_, index);
 }
 
-PP_Bool PluginInstanceImpl::IsFullscreen(PP_Instance instance) {
+PP_Bool PepperPluginInstanceImpl::IsFullscreen(PP_Instance instance) {
   return PP_FromBool(view_data_.is_fullscreen);
 }
 
-PP_Bool PluginInstanceImpl::SetFullscreen(PP_Instance instance,
-                                          PP_Bool fullscreen) {
+PP_Bool PepperPluginInstanceImpl::SetFullscreen(PP_Instance instance,
+                                                PP_Bool fullscreen) {
   return PP_FromBool(SetFullscreen(PP_ToBool(fullscreen)));
 }
 
-PP_Bool PluginInstanceImpl::GetScreenSize(PP_Instance instance, PP_Size* size) {
+PP_Bool PepperPluginInstanceImpl::GetScreenSize(PP_Instance instance,
+                                                PP_Size* size) {
   gfx::Size screen_size = delegate()->GetScreenSize();
   *size = PP_MakeSize(screen_size.width(), screen_size.height());
   return PP_TRUE;
 }
 
-::ppapi::Resource* PluginInstanceImpl::GetSingletonResource(
+::ppapi::Resource* PepperPluginInstanceImpl::GetSingletonResource(
     PP_Instance instance,
     ::ppapi::SingletonResourceID id) {
   // Flash APIs and some others aren't implemented in-process.
@@ -2157,15 +2180,15 @@
   return NULL;
 }
 
-int32_t PluginInstanceImpl::RequestInputEvents(PP_Instance instance,
-                                               uint32_t event_classes) {
+int32_t PepperPluginInstanceImpl::RequestInputEvents(PP_Instance instance,
+                                                     uint32_t event_classes) {
   input_event_mask_ |= event_classes;
   filtered_input_event_mask_ &= ~(event_classes);
   RequestInputEventsHelper(event_classes);
   return ValidateRequestInputEvents(false, event_classes);
 }
 
-int32_t PluginInstanceImpl::RequestFilteringInputEvents(
+int32_t PepperPluginInstanceImpl::RequestFilteringInputEvents(
     PP_Instance instance,
     uint32_t event_classes) {
   filtered_input_event_mask_ |= event_classes;
@@ -2174,24 +2197,25 @@
   return ValidateRequestInputEvents(true, event_classes);
 }
 
-void PluginInstanceImpl::ClearInputEventRequest(PP_Instance instance,
-                                                uint32_t event_classes) {
+void PepperPluginInstanceImpl::ClearInputEventRequest(PP_Instance instance,
+                                                      uint32_t event_classes) {
   input_event_mask_ &= ~(event_classes);
   filtered_input_event_mask_ &= ~(event_classes);
   RequestInputEventsHelper(event_classes);
 }
 
-void PluginInstanceImpl::ZoomChanged(PP_Instance instance, double factor) {
+void PepperPluginInstanceImpl::ZoomChanged(PP_Instance instance,
+                                           double factor) {
   // We only want to tell the page to change its zoom if the whole page is the
   // plugin.  If we're in an iframe, then don't do anything.
   if (!IsFullPagePlugin())
     return;
-  container()->zoomLevelChanged(WebView::zoomFactorToZoomLevel(factor));
+  container()->zoomLevelChanged(content::ZoomFactorToZoomLevel(factor));
 }
 
-void PluginInstanceImpl::ZoomLimitsChanged(PP_Instance instance,
-                                           double minimum_factor,
-                                           double maximium_factor) {
+void PepperPluginInstanceImpl::ZoomLimitsChanged(PP_Instance instance,
+                                                 double minimum_factor,
+                                                 double maximium_factor) {
   if (minimum_factor > maximium_factor) {
     NOTREACHED();
     return;
@@ -2199,14 +2223,15 @@
   delegate()->ZoomLimitsChanged(minimum_factor, maximium_factor);
 }
 
-void PluginInstanceImpl::PostMessage(PP_Instance instance, PP_Var message) {
+void PepperPluginInstanceImpl::PostMessage(PP_Instance instance,
+                                           PP_Var message) {
   message_channel_->PostMessageToJavaScript(message);
 }
 
-PP_Bool PluginInstanceImpl::SetCursor(PP_Instance instance,
-                                      PP_MouseCursor_Type type,
-                                      PP_Resource image,
-                                      const PP_Point* hot_spot) {
+PP_Bool PepperPluginInstanceImpl::SetCursor(PP_Instance instance,
+                                            PP_MouseCursor_Type type,
+                                            PP_Resource image,
+                                            const PP_Point* hot_spot) {
   if (!ValidateSetCursorParams(type, image, hot_spot))
     return PP_FALSE;
 
@@ -2242,8 +2267,9 @@
   return PP_TRUE;
 }
 
-int32_t PluginInstanceImpl::LockMouse(PP_Instance instance,
-                                      scoped_refptr<TrackedCallback> callback) {
+int32_t PepperPluginInstanceImpl::LockMouse(
+    PP_Instance instance,
+    scoped_refptr<TrackedCallback> callback) {
   if (TrackedCallback::IsPending(lock_mouse_callback_))
     return PP_ERROR_INPROGRESS;
 
@@ -2271,12 +2297,12 @@
   return PP_OK_COMPLETIONPENDING;
 }
 
-void PluginInstanceImpl::UnlockMouse(PP_Instance instance) {
+void PepperPluginInstanceImpl::UnlockMouse(PP_Instance instance) {
   delegate()->UnlockMouse(this);
 }
 
-void PluginInstanceImpl::SetTextInputType(PP_Instance instance,
-                                          PP_TextInput_Type type) {
+void PepperPluginInstanceImpl::SetTextInputType(PP_Instance instance,
+                                                PP_TextInput_Type type) {
   int itype = type;
   if (itype < 0 || itype > ui::TEXT_INPUT_TYPE_URL)
     itype = ui::TEXT_INPUT_TYPE_NONE;
@@ -2284,20 +2310,21 @@
   delegate()->PluginTextInputTypeChanged(this);
 }
 
-void PluginInstanceImpl::UpdateCaretPosition(PP_Instance instance,
-                                             const PP_Rect& caret,
-                                             const PP_Rect& bounding_box) {
+void PepperPluginInstanceImpl::UpdateCaretPosition(
+    PP_Instance instance,
+    const PP_Rect& caret,
+    const PP_Rect& bounding_box) {
   text_input_caret_ = PP_ToGfxRect(caret);
   text_input_caret_bounds_ = PP_ToGfxRect(bounding_box);
   text_input_caret_set_ = true;
   delegate()->PluginCaretPositionChanged(this);
 }
 
-void PluginInstanceImpl::CancelCompositionText(PP_Instance instance) {
+void PepperPluginInstanceImpl::CancelCompositionText(PP_Instance instance) {
   delegate()->PluginRequestedCancelComposition(this);
 }
 
-void PluginInstanceImpl::SelectionChanged(PP_Instance instance) {
+void PepperPluginInstanceImpl::SelectionChanged(PP_Instance instance) {
   // TODO(kinaba): currently the browser always calls RequestSurroundingText.
   // It can be optimized so that it won't call it back until the information
   // is really needed.
@@ -2308,22 +2335,22 @@
   // lifetime of the instance.
   base::MessageLoop::current()->PostTask(
       FROM_HERE,
-      base::Bind(&PluginInstanceImpl::RequestSurroundingText,
+      base::Bind(&PepperPluginInstanceImpl::RequestSurroundingText,
                  AsWeakPtr(),
                  static_cast<size_t>(kExtraCharsForTextInput)));
 }
 
-void PluginInstanceImpl::UpdateSurroundingText(PP_Instance instance,
-                                               const char* text,
-                                               uint32_t caret,
-                                               uint32_t anchor) {
+void PepperPluginInstanceImpl::UpdateSurroundingText(PP_Instance instance,
+                                                     const char* text,
+                                                     uint32_t caret,
+                                                     uint32_t anchor) {
   surrounding_text_ = text;
   selection_caret_ = caret;
   selection_anchor_ = anchor;
   delegate()->PluginSelectionChanged(this);
 }
 
-PP_Var PluginInstanceImpl::ResolveRelativeToDocument(
+PP_Var PepperPluginInstanceImpl::ResolveRelativeToDocument(
     PP_Instance instance,
     PP_Var relative,
     PP_URLComponents_Dev* components) {
@@ -2338,8 +2365,8 @@
       components);
 }
 
-PP_Bool PluginInstanceImpl::DocumentCanRequest(PP_Instance instance,
-                                               PP_Var url) {
+PP_Bool PepperPluginInstanceImpl::DocumentCanRequest(PP_Instance instance,
+                                                     PP_Var url) {
   StringVar* url_string = StringVar::FromPPVar(url);
   if (!url_string)
     return PP_FALSE;
@@ -2355,8 +2382,9 @@
   return BoolToPPBool(security_origin.canRequest(gurl));
 }
 
-PP_Bool PluginInstanceImpl::DocumentCanAccessDocument(PP_Instance instance,
-                                                      PP_Instance target) {
+PP_Bool PepperPluginInstanceImpl::DocumentCanAccessDocument(
+    PP_Instance instance,
+    PP_Instance target) {
   WebKit::WebSecurityOrigin our_origin;
   if (!SecurityOriginForInstance(instance, &our_origin))
     return PP_FALSE;
@@ -2368,21 +2396,22 @@
   return BoolToPPBool(our_origin.canAccess(target_origin));
 }
 
-PP_Var PluginInstanceImpl::GetDocumentURL(PP_Instance instance,
-                                          PP_URLComponents_Dev* components) {
+PP_Var PepperPluginInstanceImpl::GetDocumentURL(
+    PP_Instance instance,
+    PP_URLComponents_Dev* components) {
   WebKit::WebDocument document = container()->element().document();
   return ::ppapi::PPB_URLUtil_Shared::GenerateURLReturn(document.url(),
                                                         components);
 }
 
-PP_Var PluginInstanceImpl::GetPluginInstanceURL(
+PP_Var PepperPluginInstanceImpl::GetPluginInstanceURL(
     PP_Instance instance,
     PP_URLComponents_Dev* components) {
   return ::ppapi::PPB_URLUtil_Shared::GenerateURLReturn(plugin_url_,
                                                         components);
 }
 
-PP_ExternalPluginResult PluginInstanceImpl::ResetAsProxied(
+PP_ExternalPluginResult PepperPluginInstanceImpl::ResetAsProxied(
     scoped_refptr<PluginModule> module) {
   // Save the original module and switch over to the new one now that this
   // plugin is using the IPC-based proxy.
@@ -2453,54 +2482,53 @@
   return PP_EXTERNAL_PLUGIN_OK;
 }
 
-bool PluginInstanceImpl::IsValidInstanceOf(PluginModule* module) {
+bool PepperPluginInstanceImpl::IsValidInstanceOf(PluginModule* module) {
   DCHECK(module);
   return module == module_.get() ||
          module == original_module_.get();
 }
 
-NPP PluginInstanceImpl::instanceNPP() {
+NPP PepperPluginInstanceImpl::instanceNPP() {
   return npp_.get();
 }
 
-v8::Isolate* PluginInstanceImpl::GetIsolate() const {
+v8::Isolate* PepperPluginInstanceImpl::GetIsolate() const {
   return isolate_;
 }
 
-PluginInstance* PluginInstance::Get(PP_Instance instance_id) {
+PepperPluginInstance* PepperPluginInstance::Get(PP_Instance instance_id) {
   return HostGlobals::Get()->GetInstance(instance_id);
 }
 
-content::RenderView* PluginInstanceImpl::GetRenderView() {
+RenderView* PepperPluginInstanceImpl::GetRenderView() {
   return render_view_;
 }
 
-WebKit::WebPluginContainer* PluginInstanceImpl::GetContainer() {
+WebKit::WebPluginContainer* PepperPluginInstanceImpl::GetContainer() {
   return container_;
 }
 
-::ppapi::VarTracker* PluginInstanceImpl::GetVarTracker() {
+::ppapi::VarTracker* PepperPluginInstanceImpl::GetVarTracker() {
   return HostGlobals::Get()->GetVarTracker();
 }
 
-const GURL& PluginInstanceImpl::GetPluginURL() {
+const GURL& PepperPluginInstanceImpl::GetPluginURL() {
   return plugin_url_;
 }
 
-base::FilePath PluginInstanceImpl::GetModulePath() {
+base::FilePath PepperPluginInstanceImpl::GetModulePath() {
   return module_->path();
 }
 
-PP_Resource PluginInstanceImpl::CreateExternalFileReference(
+PP_Resource PepperPluginInstanceImpl::CreateExternalFileReference(
     const base::FilePath& external_file_path) {
-  webkit::ppapi::PPB_FileRef_Impl* ref =
-      webkit::ppapi::PPB_FileRef_Impl::CreateExternal(
-          pp_instance(), external_file_path, "");
+  PPB_FileRef_Impl* ref = PPB_FileRef_Impl::CreateExternal(
+      pp_instance(), external_file_path, "");
   return ref->GetReference();
 }
 
-PP_Resource PluginInstanceImpl::CreateImage(gfx::ImageSkia* source_image,
-                                            float scale) {
+PP_Resource PepperPluginInstanceImpl::CreateImage(gfx::ImageSkia* source_image,
+                                                  float scale) {
   ui::ScaleFactor scale_factor = ui::GetScaleFactorFromScale(scale);
   gfx::ImageSkiaRep image_skia_rep = source_image->GetRepresentation(
       scale_factor);
@@ -2508,19 +2536,18 @@
   if (image_skia_rep.is_null() || image_skia_rep.scale_factor() != scale_factor)
     return 0;
 
-  scoped_refptr<webkit::ppapi::PPB_ImageData_Impl> image_data(
-      new webkit::ppapi::PPB_ImageData_Impl(
-          pp_instance(),
-          webkit::ppapi::PPB_ImageData_Impl::PLATFORM));
+  scoped_refptr<PPB_ImageData_Impl> image_data(new PPB_ImageData_Impl(
+      pp_instance(),
+      PPB_ImageData_Impl::PLATFORM));
   if (!image_data->Init(
-          webkit::ppapi::PPB_ImageData_Impl::GetNativeImageDataFormat(),
+          PPB_ImageData_Impl::GetNativeImageDataFormat(),
           image_skia_rep.pixel_width(),
           image_skia_rep.pixel_height(),
           false)) {
     return 0;
   }
 
-  webkit::ppapi::ImageDataAutoMapper mapper(image_data.get());
+  ImageDataAutoMapper mapper(image_data.get());
   if (!mapper.is_valid())
     return 0;
 
@@ -2532,7 +2559,7 @@
   return image_data->GetReference();
 }
 
-PP_ExternalPluginResult PluginInstanceImpl::SwitchToOutOfProcessProxy(
+PP_ExternalPluginResult PepperPluginInstanceImpl::SwitchToOutOfProcessProxy(
     const base::FilePath& file_path,
     ::ppapi::PpapiPermissions permissions,
     const IPC::ChannelHandle& channel_handle,
@@ -2542,10 +2569,10 @@
   // the IPC based out-of-process proxy. We can't use the existing module,
   // because it is configured for the in-process plugin, and we must keep it
   // that way to allow the page to create other instances.
-  scoped_refptr<webkit::ppapi::PluginModule> external_plugin_module(
+  scoped_refptr<PluginModule> external_plugin_module(
       module_->CreateModuleForExternalPluginInstance());
 
-  content::RendererPpapiHost* renderer_ppapi_host =
+  RendererPpapiHost* renderer_ppapi_host =
       delegate_->CreateExternalPluginModule(
           external_plugin_module,
           file_path,
@@ -2562,11 +2589,11 @@
   return external_plugin_module->InitAsProxiedExternalPlugin(this);
 }
 
-void PluginInstanceImpl::SetAlwaysOnTop(bool on_top) {
+void PepperPluginInstanceImpl::SetAlwaysOnTop(bool on_top) {
   always_on_top_ = on_top;
 }
 
-void PluginInstanceImpl::DoSetCursor(WebCursorInfo* cursor) {
+void PepperPluginInstanceImpl::DoSetCursor(WebCursorInfo* cursor) {
   cursor_.reset(cursor);
   if (fullscreen_container_) {
     fullscreen_container_->DidChangeCursor(*cursor);
@@ -2575,16 +2602,16 @@
   }
 }
 
-bool PluginInstanceImpl::IsFullPagePlugin() {
+bool PepperPluginInstanceImpl::IsFullPagePlugin() {
   WebFrame* frame = container()->element().document().frame();
   return frame->view()->mainFrame()->document().isPluginDocument();
 }
 
-void PluginInstanceImpl::FlashSetFullscreen(bool fullscreen,
-                                            bool delay_report) {
-  TRACE_EVENT0("ppapi", "PluginInstanceImpl::FlashSetFullscreen");
+void PepperPluginInstanceImpl::FlashSetFullscreen(bool fullscreen,
+                                                  bool delay_report) {
+  TRACE_EVENT0("ppapi", "PepperPluginInstanceImpl::FlashSetFullscreen");
   // Keep a reference on the stack. See NOTE above.
-  scoped_refptr<PluginInstanceImpl> ref(this);
+  scoped_refptr<PepperPluginInstanceImpl> ref(this);
 
   // We check whether we are trying to switch to the state we're already going
   // to (i.e. if we're already switching to fullscreen but the fullscreen
@@ -2607,21 +2634,23 @@
       ReportGeometry();
     } else {
       base::MessageLoop::current()->PostTask(
-          FROM_HERE, base::Bind(&PluginInstanceImpl::ReportGeometry, this));
+          FROM_HERE,
+          base::Bind(&PepperPluginInstanceImpl::ReportGeometry, this));
     }
   }
 }
 
-bool PluginInstanceImpl::IsRectTopmost(const gfx::Rect& rect) {
+bool PepperPluginInstanceImpl::IsRectTopmost(const gfx::Rect& rect) {
   if (flash_fullscreen_)
     return true;
 
   return container_->isRectTopmost(rect);
 }
 
-int32_t PluginInstanceImpl::Navigate(const ::ppapi::URLRequestInfoData& request,
-                                     const char* target,
-                                     bool from_user_action) {
+int32_t PepperPluginInstanceImpl::Navigate(
+    const ::ppapi::URLRequestInfoData& request,
+    const char* target,
+    bool from_user_action) {
   if (!container_)
     return PP_ERROR_FAILED;
 
@@ -2663,7 +2692,7 @@
   return PP_OK;
 }
 
-bool PluginInstanceImpl::CanAccessMainFrame() const {
+bool PepperPluginInstanceImpl::CanAccessMainFrame() const {
   if (!container_)
     return false;
   WebKit::WebDocument containing_document = container_->element().document();
@@ -2680,7 +2709,7 @@
       main_document.securityOrigin());
 }
 
-void PluginInstanceImpl::KeepSizeAttributesBeforeFullscreen() {
+void PepperPluginInstanceImpl::KeepSizeAttributesBeforeFullscreen() {
   WebElement element = container_->element();
   width_before_fullscreen_ = element.getAttribute(WebString::fromUTF8(kWidth));
   height_before_fullscreen_ =
@@ -2690,7 +2719,7 @@
   style_before_fullscreen_ = element.getAttribute(WebString::fromUTF8(kStyle));
 }
 
-void PluginInstanceImpl::SetSizeAttributesForFullscreen() {
+void PepperPluginInstanceImpl::SetSizeAttributesForFullscreen() {
   screen_size_for_fullscreen_ = delegate()->GetScreenSize();
   std::string width = StringPrintf("%d", screen_size_for_fullscreen_.width());
   std::string height = StringPrintf("%d", screen_size_for_fullscreen_.height());
@@ -2713,7 +2742,7 @@
   container_->element().setAttribute(kStyle, WebString::fromUTF8(style));
 }
 
-void PluginInstanceImpl::ResetSizeAttributesAfterFullscreen() {
+void PepperPluginInstanceImpl::ResetSizeAttributesAfterFullscreen() {
   screen_size_for_fullscreen_ = gfx::Size();
   WebElement element = container_->element();
   element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_);
@@ -2722,5 +2751,4 @@
   element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_);
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/ppapi_plugin_instance_impl.h b/content/renderer/pepper/pepper_plugin_instance_impl.h
similarity index 95%
rename from content/renderer/pepper/ppapi_plugin_instance_impl.h
rename to content/renderer/pepper/pepper_plugin_instance_impl.h
index c5d22c4..9b01645 100644
--- a/content/renderer/pepper/ppapi_plugin_instance_impl.h
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_RENDERER_PEPPER_PPAPI_PLUGIN_INSTANCE_IMPL_H_
-#define CONTENT_RENDERER_PEPPER_PPAPI_PLUGIN_INSTANCE_IMPL_H_
+#ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_
+#define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_
 
 #include <set>
 #include <string>
@@ -16,7 +16,7 @@
 #include "base/strings/string16.h"
 #include "cc/layers/texture_layer_client.h"
 #include "content/common/content_export.h"
-#include "content/public/renderer/ppapi_plugin_instance.h"
+#include "content/public/renderer/pepper_plugin_instance.h"
 #include "content/renderer/pepper/plugin_delegate.h"
 #include "content/renderer/pepper/ppp_pdf.h"
 #include "ppapi/c/dev/pp_cursor_type_dev.h"
@@ -92,8 +92,7 @@
 class Isolate;
 }
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class ContentDecryptorDelegate;
 class FullscreenContainer;
@@ -107,21 +106,21 @@
 
 // Represents one time a plugin appears on one web page.
 //
-// Note: to get from a PP_Instance to a PluginInstance*, use the
+// Note: to get from a PP_Instance to a PepperPluginInstance*, use the
 // ResourceTracker.
-class CONTENT_EXPORT PluginInstanceImpl
-    : public base::RefCounted<PluginInstanceImpl>,
-      public base::SupportsWeakPtr<PluginInstanceImpl>,
-      public NON_EXPORTED_BASE(PluginInstance),
+class CONTENT_EXPORT PepperPluginInstanceImpl
+    : public base::RefCounted<PepperPluginInstanceImpl>,
+      public base::SupportsWeakPtr<PepperPluginInstanceImpl>,
+      public NON_EXPORTED_BASE(PepperPluginInstance),
       public ::ppapi::PPB_Instance_Shared {
  public:
-  // Create and return a PluginInstanceImpl object which supports the most
+  // Create and return a PepperPluginInstanceImpl object which supports the most
   // recent version of PPP_Instance possible by querying the given
   // get_plugin_interface function. If the plugin does not support any valid
   // PPP_Instance interface, returns NULL.
-  static PluginInstanceImpl* Create(
+  static PepperPluginInstanceImpl* Create(
       PluginDelegate* delegate,
-      content::RenderView* render_view,
+      RenderView* render_view,
       PluginModule* module,
       WebKit::WebPluginContainer* container,
       const GURL& plugin_url);
@@ -352,8 +351,8 @@
 
   ContentDecryptorDelegate* GetContentDecryptorDelegate();
 
-  // webkit::ppapi::PluginInstance implementation
-  virtual content::RenderView* GetRenderView() OVERRIDE;
+  // PluginInstance implementation
+  virtual RenderView* GetRenderView() OVERRIDE;
   virtual WebKit::WebPluginContainer* GetContainer() OVERRIDE;
   virtual ::ppapi::VarTracker* GetVarTracker() OVERRIDE;
   virtual const GURL& GetPluginURL() OVERRIDE;
@@ -508,11 +507,11 @@
   v8::Isolate* GetIsolate() const;
 
  private:
-  friend class base::RefCounted<PluginInstanceImpl>;
+  friend class base::RefCounted<PepperPluginInstanceImpl>;
   friend class PpapiUnittest;
 
   // Delete should be called by the WebPlugin before this destructor.
-  virtual ~PluginInstanceImpl();
+  virtual ~PepperPluginInstanceImpl();
 
   // Class to record document load notifications and play them back once the
   // real document loader becomes available. Used only by NaCl instances.
@@ -540,7 +539,7 @@
   };
 
   // Implements PPB_Gamepad_API. This is just to avoid having an excessive
-  // number of interfaces implemented by PluginInstanceImpl.
+  // number of interfaces implemented by PepperPluginInstanceImpl.
   class GamepadImpl : public ::ppapi::thunk::PPB_Gamepad_API,
                       public ::ppapi::Resource {
    public:
@@ -554,16 +553,16 @@
     PluginDelegate* delegate_;
   };
 
-  // See the static Create functions above for creating PluginInstanceImpl
+  // See the static Create functions above for creating PepperPluginInstanceImpl
   // objects. This constructor is private so that we can hide the
   // PPP_Instance_Combined details while still having 1 constructor to maintain
   // for member initialization.
-  PluginInstanceImpl(PluginDelegate* delegate,
-                     content::RenderView* render_view,
-                     PluginModule* module,
-                     ::ppapi::PPP_Instance_Combined* instance_interface,
-                     WebKit::WebPluginContainer* container,
-                     const GURL& plugin_url);
+  PepperPluginInstanceImpl(PluginDelegate* delegate,
+                           RenderView* render_view,
+                           PluginModule* module,
+                           ::ppapi::PPP_Instance_Combined* instance_interface,
+                           WebKit::WebPluginContainer* container,
+                           const GURL& plugin_url);
 
   bool LoadFindInterface();
   bool LoadInputEventInterface();
@@ -649,7 +648,7 @@
   void ResetSizeAttributesAfterFullscreen();
 
   PluginDelegate* delegate_;
-  content::RenderView* render_view_;
+  RenderView* render_view_;
   scoped_refptr<PluginModule> module_;
   scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_;
   // If this is the NaCl plugin, we create a new module when we switch to the
@@ -689,7 +688,7 @@
   // already a weak ptr pending (HasWeakPtrs is true), code should update the
   // view_data_ but not send updates. This also allows us to cancel scheduled
   // view change events.
-  base::WeakPtrFactory<PluginInstanceImpl> view_change_weak_ptr_factory_;
+  base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_;
 
   // The current device context for painting in 2D and 3D.
   scoped_refptr<PPB_Graphics3D_Impl> bound_graphics_3d_;
@@ -855,10 +854,9 @@
   v8::Isolate* isolate_;
 
   friend class PpapiPluginInstanceTest;
-  DISALLOW_COPY_AND_ASSIGN(PluginInstanceImpl);
+  DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
-#endif  // CONTENT_RENDERER_PEPPER_PPAPI_PLUGIN_INSTANCE_IMPL_H_
+#endif  // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_
diff --git a/content/renderer/pepper/ppapi_plugin_instance_unittest.cc b/content/renderer/pepper/pepper_plugin_instance_unittest.cc
similarity index 94%
rename from content/renderer/pepper/ppapi_plugin_instance_unittest.cc
rename to content/renderer/pepper/pepper_plugin_instance_unittest.cc
index ceaac04..5aa6e4a 100644
--- a/content/renderer/pepper/ppapi_plugin_instance_unittest.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_unittest.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 
 #include "base/basictypes.h"
 #include "base/memory/ref_counted.h"
@@ -13,8 +13,7 @@
 #include "ui/gfx/rect.h"
 #include "ui/gfx/safe_integer_conversions.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 
@@ -41,7 +40,7 @@
                              const PP_Point* top_left) OVERRIDE {
     return false;
   }
-  virtual bool BindToInstance(PluginInstanceImpl* new_instance) OVERRIDE {
+  virtual bool BindToInstance(PepperPluginInstanceImpl* new_instance) OVERRIDE {
     bound_instance_ = new_instance;
     return true;
   }
@@ -62,7 +61,7 @@
  private:
   PPB_ImageData_Impl* image_data_;
   float scale_;
-  PluginInstanceImpl* bound_instance_;
+  PepperPluginInstanceImpl* bound_instance_;
 
   DISALLOW_COPY_AND_ASSIGN(MockPlatformGraphics2D);
 };
@@ -123,5 +122,4 @@
   EXPECT_EQ(scale, bitmap_scale);
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/pepper_plugin_registry.cc b/content/renderer/pepper/pepper_plugin_registry.cc
index 96634d1..a5ae346 100644
--- a/content/renderer/pepper/pepper_plugin_registry.cc
+++ b/content/renderer/pepper/pepper_plugin_registry.cc
@@ -40,8 +40,7 @@
   return &plugin_list_[plugin_list_.size() - 1];
 }
 
-webkit::ppapi::PluginModule* PepperPluginRegistry::GetLiveModule(
-    const base::FilePath& path) {
+PluginModule* PepperPluginRegistry::GetLiveModule(const base::FilePath& path) {
   NonOwningModuleMap::iterator it = live_modules_.find(path);
   if (it == live_modules_.end())
     return NULL;
@@ -49,13 +48,12 @@
 }
 
 void PepperPluginRegistry::AddLiveModule(const base::FilePath& path,
-                                         webkit::ppapi::PluginModule* module) {
+                                         PluginModule* module) {
   DCHECK(live_modules_.find(path) == live_modules_.end());
   live_modules_[path] = module;
 }
 
-void PepperPluginRegistry::PluginModuleDead(
-    webkit::ppapi::PluginModule* dead_module) {
+void PepperPluginRegistry::PluginModuleDead(PluginModule* dead_module) {
   // DANGER: Don't dereference the dead_module pointer! It may be in the
   // process of being deleted.
 
@@ -92,9 +90,9 @@
     if (current.is_out_of_process)
       continue;  // Out of process plugins need no special pre-initialization.
 
-    scoped_refptr<webkit::ppapi::PluginModule> module =
-        new webkit::ppapi::PluginModule(current.name, current.path,
-            ppapi::PpapiPermissions(current.permissions));
+    scoped_refptr<PluginModule> module = new PluginModule(
+        current.name, current.path,
+        ppapi::PpapiPermissions(current.permissions));
     AddLiveModule(current.path, module.get());
     if (current.is_internal) {
       if (!module->InitAsInternalPlugin(current.internal_entry_points)) {
diff --git a/content/renderer/pepper/pepper_plugin_registry.h b/content/renderer/pepper/pepper_plugin_registry.h
index ee8fd7c..7bd6ff9 100644
--- a/content/renderer/pepper/pepper_plugin_registry.h
+++ b/content/renderer/pepper/pepper_plugin_registry.h
@@ -11,13 +11,8 @@
 #include "base/memory/ref_counted.h"
 #include "content/public/common/pepper_plugin_info.h"
 
-namespace webkit {
-namespace ppapi {
-class PluginModule;
-}
-}
-
 namespace content {
+class PluginModule;
 
 // This class holds references to all of the known pepper plugin modules.
 //
@@ -40,16 +35,15 @@
   // both preloaded in-process or currently active (non crashed) out-of-process
   // plugins matching the given name. Returns NULL if the plugin hasn't been
   // loaded.
-  webkit::ppapi::PluginModule* GetLiveModule(const base::FilePath& path);
+  PluginModule* GetLiveModule(const base::FilePath& path);
 
   // Notifies the registry that a new non-preloaded module has been created.
   // This is normally called for out-of-process plugins. Once this is called,
   // the module is available to be returned by GetModule(). The module will
   // automatically unregister itself by calling PluginModuleDestroyed().
-  void AddLiveModule(const base::FilePath& path,
-                     webkit::ppapi::PluginModule* module);
+  void AddLiveModule(const base::FilePath& path, PluginModule* module);
 
-  void PluginModuleDead(webkit::ppapi::PluginModule* dead_module);
+  void PluginModuleDead(PluginModule* dead_module);
 
  private:
   PepperPluginRegistry();
@@ -59,8 +53,7 @@
 
   // Plugins that have been preloaded so they can be executed in-process in
   // the renderer (the sandbox prevents on-demand loading).
-  typedef std::map<base::FilePath,
-                   scoped_refptr<webkit::ppapi::PluginModule> >
+  typedef std::map<base::FilePath, scoped_refptr<PluginModule> >
       OwningModuleMap;
   OwningModuleMap preloaded_modules_;
 
@@ -70,8 +63,7 @@
   // non-crashed modules. If an out-of-process module crashes, it may
   // continue as long as there are WebKit references to it, but it will not
   // appear in this list.
-  typedef std::map<base::FilePath, webkit::ppapi::PluginModule*>
-      NonOwningModuleMap;
+  typedef std::map<base::FilePath, PluginModule*> NonOwningModuleMap;
   NonOwningModuleMap live_modules_;
 
   DISALLOW_COPY_AND_ASSIGN(PepperPluginRegistry);
diff --git a/content/renderer/pepper/pepper_truetype_font_linux.cc b/content/renderer/pepper/pepper_truetype_font_linux.cc
index 2e3326a..53abf13 100644
--- a/content/renderer/pepper/pepper_truetype_font_linux.cc
+++ b/content/renderer/pepper/pepper_truetype_font_linux.cc
@@ -65,11 +65,11 @@
     }
   }
 
-  fd_ = content::MatchFontWithFallback(
-            desc_.family.c_str(),
-            desc_.weight >= PP_TRUETYPEFONTWEIGHT_BOLD,
-            desc_.style & PP_TRUETYPEFONTSTYLE_ITALIC,
-            desc_.charset);
+  fd_ = MatchFontWithFallback(
+      desc_.family.c_str(),
+      desc_.weight >= PP_TRUETYPEFONTWEIGHT_BOLD,
+      desc_.style & PP_TRUETYPEFONTSTYLE_ITALIC,
+      desc_.charset);
 }
 
 PepperTrueTypeFontLinux::~PepperTrueTypeFontLinux() {
@@ -89,11 +89,11 @@
   // Get the 2 byte numTables field at an offset of 4 in the font.
   uint8_t num_tables_buf[2];
   size_t output_length = sizeof(num_tables_buf);
-  if (!content::GetFontTable(fd_,
-                             0 /* tag */,
-                             4 /* offset */,
-                             reinterpret_cast<uint8_t*>(&num_tables_buf),
-                             &output_length))
+  if (!GetFontTable(fd_,
+                    0 /* tag */,
+                    4 /* offset */,
+                    reinterpret_cast<uint8_t*>(&num_tables_buf),
+                    &output_length))
     return PP_ERROR_FAILED;
   DCHECK(output_length == sizeof(num_tables_buf));
   // Font data is stored in big-endian order.
@@ -105,11 +105,11 @@
   output_length = num_tables * kTableEntrySize;
   scoped_ptr<uint8_t[]> table_entries(new uint8_t[output_length]);
   // Get the table directory entries, which follow the font header.
-  if (!content::GetFontTable(fd_,
-                             0 /* tag */,
-                             kFontHeaderSize /* offset */,
-                             table_entries.get(),
-                             &output_length))
+  if (!GetFontTable(fd_,
+                    0 /* tag */,
+                    kFontHeaderSize /* offset */,
+                    table_entries.get(),
+                    &output_length))
     return PP_ERROR_FAILED;
   DCHECK(output_length == num_tables * kTableEntrySize);
 
@@ -134,14 +134,14 @@
   size_t table_size = 0;
   // Tags are byte swapped on Linux.
   table_tag = base::ByteSwap(table_tag);
-  if (!content::GetFontTable(fd_, table_tag, offset, NULL, &table_size))
+  if (!GetFontTable(fd_, table_tag, offset, NULL, &table_size))
     return PP_ERROR_FAILED;
   // Only retrieve as much as the caller requested.
   table_size = std::min(table_size, static_cast<size_t>(max_data_length));
   data->resize(table_size);
-  if (!content::GetFontTable(fd_, table_tag, offset,
-                             reinterpret_cast<uint8_t*>(&(*data)[0]),
-                             &table_size))
+  if (!GetFontTable(fd_, table_tag, offset,
+                    reinterpret_cast<uint8_t*>(&(*data)[0]),
+                    &table_size))
     return PP_ERROR_FAILED;
 
   return base::checked_numeric_cast<int32_t>(table_size);
diff --git a/content/renderer/pepper/pepper_truetype_font_win.cc b/content/renderer/pepper/pepper_truetype_font_win.cc
index 95da297..e515bd1 100644
--- a/content/renderer/pepper/pepper_truetype_font_win.cc
+++ b/content/renderer/pepper/pepper_truetype_font_win.cc
@@ -152,7 +152,7 @@
     LOGFONTW logfont;
     if (!::GetObject(font_, sizeof(LOGFONTW), &logfont))
       return GDI_ERROR;
-    content::RenderThread* render_thread = content::RenderThread::Get();
+    RenderThread* render_thread = RenderThread::Get();
     if (!render_thread)
       return GDI_ERROR;
     render_thread->PreCacheFont(logfont);
diff --git a/content/renderer/pepper/pepper_url_loader_host.cc b/content/renderer/pepper/pepper_url_loader_host.cc
index 3087ebc..e60096a 100644
--- a/content/renderer/pepper/pepper_url_loader_host.cc
+++ b/content/renderer/pepper/pepper_url_loader_host.cc
@@ -4,7 +4,7 @@
 
 #include "content/renderer/pepper/pepper_url_loader_host.h"
 
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/renderer_ppapi_host_impl.h"
 #include "content/renderer/pepper/url_request_info_util.h"
 #include "content/renderer/pepper/url_response_info_util.h"
@@ -83,7 +83,7 @@
   // will get queued inside WebKit.
   if (main_document_loader_) {
     // The PluginInstance has a non-owning pointer to us.
-    webkit::ppapi::PluginInstanceImpl* instance_object =
+    PepperPluginInstanceImpl* instance_object =
         renderer_ppapi_host_->GetPluginInstanceImpl(pp_instance());
     if (instance_object) {
       DCHECK(instance_object->document_loader() == this);
@@ -235,8 +235,7 @@
   // the file refs.
   ppapi::URLRequestInfoData filled_in_request_data = request_data;
 
-  if (webkit::ppapi::URLRequestRequiresUniversalAccess(
-          filled_in_request_data) &&
+  if (URLRequestRequiresUniversalAccess(filled_in_request_data) &&
       !has_universal_access_) {
     ppapi::PpapiGlobals::Get()->LogWithSource(
         pp_instance(), PP_LOGLEVEL_ERROR, std::string(),
@@ -254,8 +253,7 @@
   if (!frame)
     return PP_ERROR_FAILED;
   WebURLRequest web_request;
-  if (!webkit::ppapi::CreateWebURLRequest(&filled_in_request_data, frame,
-                                          &web_request))
+  if (!CreateWebURLRequest(&filled_in_request_data, frame, &web_request))
     return PP_ERROR_FAILED;
   web_request.setRequestorProcessID(renderer_ppapi_host_->GetPluginPID());
 
@@ -331,7 +329,7 @@
 }
 
 WebKit::WebFrame* PepperURLLoaderHost::GetFrame() {
-  webkit::ppapi::PluginInstance* instance_object =
+  PepperPluginInstance* instance_object =
       renderer_ppapi_host_->GetPluginInstance(pp_instance());
   if (!instance_object)
     return NULL;
diff --git a/content/renderer/pepper/pepper_url_request_unittest.cc b/content/renderer/pepper/pepper_url_request_unittest.cc
index 08cae5a..20e7f92 100644
--- a/content/renderer/pepper/pepper_url_request_unittest.cc
+++ b/content/renderer/pepper/pepper_url_request_unittest.cc
@@ -51,10 +51,9 @@
 using ppapi::proxy::URLRequestInfoResource;
 using ppapi::URLRequestInfoData;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
-class URLRequestInfoTest : public content::RenderViewTest {
+class URLRequestInfoTest : public RenderViewTest {
  public:
   URLRequestInfoTest() : pp_instance_(1234) {
   }
@@ -253,5 +252,4 @@
 
 // TODO(bbudge) Unit tests for AppendDataToBody, AppendFileToBody.
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/pepper_video_capture_host.cc b/content/renderer/pepper/pepper_video_capture_host.cc
index cef1e88..b1aa2e8 100644
--- a/content/renderer/pepper/pepper_video_capture_host.cc
+++ b/content/renderer/pepper/pepper_video_capture_host.cc
@@ -5,7 +5,7 @@
 #include "content/renderer/pepper/pepper_video_capture_host.h"
 
 #include "content/renderer/pepper/host_globals.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/renderer_ppapi_host_impl.h"
 #include "ppapi/host/dispatch_host_message.h"
 #include "ppapi/host/ppapi_host.h"
@@ -22,8 +22,6 @@
 using ppapi::TrackedCallback;
 using ppapi::thunk::EnterResourceNoLock;
 using ppapi::thunk::PPB_Buffer_API;
-using webkit::ppapi::HostGlobals;
-using webkit::ppapi::PPB_Buffer_Impl;
 
 namespace {
 
@@ -241,8 +239,8 @@
           info, buffer_host_resources, size)));
 }
 
-webkit::ppapi::PluginDelegate* PepperVideoCaptureHost::GetPluginDelegate() {
-  webkit::ppapi::PluginInstanceImpl* instance =
+PluginDelegate* PepperVideoCaptureHost::GetPluginDelegate() {
+  PepperPluginInstanceImpl* instance =
       renderer_ppapi_host_->GetPluginInstanceImpl(pp_instance());
   if (instance)
     return instance->delegate();
@@ -257,13 +255,13 @@
   if (platform_video_capture_.get())
     return PP_ERROR_FAILED;
 
-  webkit::ppapi::PluginDelegate* plugin_delegate = GetPluginDelegate();
+  PluginDelegate* plugin_delegate = GetPluginDelegate();
   if (!plugin_delegate)
     return PP_ERROR_FAILED;
 
   SetRequestedInfo(requested_info, buffer_count);
 
-  webkit::ppapi::PluginInstance* instance =
+  PepperPluginInstance* instance =
       renderer_ppapi_host_->GetPluginInstance(pp_instance());
   if (!instance)
     return PP_ERROR_FAILED;
diff --git a/content/renderer/pepper/pepper_video_capture_host.h b/content/renderer/pepper/pepper_video_capture_host.h
index 9fdc299..e01c1b1 100644
--- a/content/renderer/pepper/pepper_video_capture_host.h
+++ b/content/renderer/pepper/pepper_video_capture_host.h
@@ -22,7 +22,7 @@
 
 class PepperVideoCaptureHost
   : public ppapi::host::ResourceHost,
-    public webkit::ppapi::PluginDelegate::PlatformVideoCaptureEventHandler,
+    public PluginDelegate::PlatformVideoCaptureEventHandler,
     public PepperDeviceEnumerationHostHelper::Delegate {
  public:
   PepperVideoCaptureHost(RendererPpapiHostImpl* host,
@@ -53,7 +53,7 @@
       const media::VideoCaptureParams& device_info) OVERRIDE;
 
   // PepperDeviceEnumerationHostHelper::Delegate implementation.
-  virtual webkit::ppapi::PluginDelegate* GetPluginDelegate() OVERRIDE;
+  virtual PluginDelegate* GetPluginDelegate() OVERRIDE;
 
  private:
   int32_t OnOpen(ppapi::host::HostMessageContext* context,
@@ -78,8 +78,7 @@
 
   bool SetStatus(PP_VideoCaptureStatus_Dev status, bool forced);
 
-  scoped_refptr<webkit::ppapi::PluginDelegate::PlatformVideoCapture>
-      platform_video_capture_;
+  scoped_refptr<PluginDelegate::PlatformVideoCapture> platform_video_capture_;
 
   // Buffers of video frame.
   struct BufferInfo {
@@ -88,7 +87,7 @@
 
     bool in_use;
     void* data;
-    scoped_refptr<webkit::ppapi::PPB_Buffer_Impl> buffer;
+    scoped_refptr<PPB_Buffer_Impl> buffer;
   };
 
   RendererPpapiHostImpl* renderer_ppapi_host_;
diff --git a/content/renderer/pepper/pepper_video_destination_host.cc b/content/renderer/pepper/pepper_video_destination_host.cc
index 2ab0657..4c19b90 100644
--- a/content/renderer/pepper/pepper_video_destination_host.cc
+++ b/content/renderer/pepper/pepper_video_destination_host.cc
@@ -53,7 +53,7 @@
   if (!gurl.is_valid())
     return PP_ERROR_BADARGUMENT;
 
-  content::FrameWriterInterface* frame_writer = NULL;
+  FrameWriterInterface* frame_writer = NULL;
   if (!VideoDestinationHandler::Open(NULL /* factory */,
                                      NULL /* registry */,
                                      gurl.spec(),
@@ -76,10 +76,10 @@
       image_data_resource.host_resource(), true);
   if (enter.failed())
     return PP_ERROR_BADRESOURCE;
-  webkit::ppapi::PPB_ImageData_Impl* image_data_impl =
-      static_cast<webkit::ppapi::PPB_ImageData_Impl*>(enter.object());
+  PPB_ImageData_Impl* image_data_impl =
+      static_cast<PPB_ImageData_Impl*>(enter.object());
 
-  if (!webkit::ppapi::PPB_ImageData_Impl::IsImageDataFormatSupported(
+  if (!PPB_ImageData_Impl::IsImageDataFormatSupported(
           image_data_impl->format()))
     return PP_ERROR_BADARGUMENT;
 
diff --git a/content/renderer/pepper/pepper_video_destination_host.h b/content/renderer/pepper/pepper_video_destination_host.h
index d65c489..fd5cfe7 100644
--- a/content/renderer/pepper/pepper_video_destination_host.h
+++ b/content/renderer/pepper/pepper_video_destination_host.h
@@ -42,7 +42,7 @@
 
   base::WeakPtrFactory<PepperVideoDestinationHost> weak_factory_;
 
-  scoped_ptr<content::FrameWriterInterface> frame_writer_;
+  scoped_ptr<FrameWriterInterface> frame_writer_;
 
   DISALLOW_COPY_AND_ASSIGN(PepperVideoDestinationHost);
 };
diff --git a/content/renderer/pepper/pepper_video_source_host.cc b/content/renderer/pepper/pepper_video_source_host.cc
index 165c5c0..eb37144 100644
--- a/content/renderer/pepper/pepper_video_source_host.cc
+++ b/content/renderer/pepper/pepper_video_source_host.cc
@@ -66,7 +66,7 @@
     : ResourceHost(host->GetPpapiHost(), instance, resource),
       renderer_ppapi_host_(host),
       weak_factory_(this),
-      source_handler_(new content::VideoSourceHandler(NULL)),
+      source_handler_(new VideoSourceHandler(NULL)),
       frame_receiver_(new FrameReceiver(weak_factory_.GetWeakPtr())),
       get_frame_pending_(false) {
 }
@@ -160,9 +160,9 @@
     return;
   }
 
-  webkit::ppapi::PPB_ImageData_Impl* image_data =
-      static_cast<webkit::ppapi::PPB_ImageData_Impl*>(enter_resource.object());
-  webkit::ppapi::ImageDataAutoMapper mapper(image_data);
+  PPB_ImageData_Impl* image_data =
+      static_cast<PPB_ImageData_Impl*>(enter_resource.object());
+  ImageDataAutoMapper mapper(image_data);
   if (!mapper.is_valid()) {
     SendGetFrameErrorReply(PP_ERROR_FAILED);
     return;
diff --git a/content/renderer/pepper/pepper_video_source_host.h b/content/renderer/pepper/pepper_video_source_host.h
index 355f43b..e5fbaa8 100644
--- a/content/renderer/pepper/pepper_video_source_host.h
+++ b/content/renderer/pepper/pepper_video_source_host.h
@@ -36,12 +36,12 @@
  private:
   // This helper object receives frames on a video worker thread and passes
   // them on to us.
-  class FrameReceiver : public content::FrameReaderInterface,
+  class FrameReceiver : public FrameReaderInterface,
                         public base::RefCountedThreadSafe<FrameReceiver> {
    public:
     explicit FrameReceiver(const base::WeakPtr<PepperVideoSourceHost>& host);
 
-    // content::FrameReaderInterface implementation.
+    // FrameReaderInterface implementation.
     virtual bool GotFrame(cricket::VideoFrame* frame) OVERRIDE;
 
     void OnGotFrame(scoped_ptr<cricket::VideoFrame> frame);
@@ -75,7 +75,7 @@
 
   ppapi::host::ReplyMessageContext reply_context_;
 
-  scoped_ptr<content::VideoSourceHandler> source_handler_;
+  scoped_ptr<VideoSourceHandler> source_handler_;
   scoped_refptr<FrameReceiver> frame_receiver_;
   std::string stream_url_;
   scoped_ptr<cricket::VideoFrame> last_frame_;
diff --git a/content/renderer/pepper/ppapi_webplugin_impl.cc b/content/renderer/pepper/pepper_webplugin_impl.cc
similarity index 72%
rename from content/renderer/pepper/ppapi_webplugin_impl.cc
rename to content/renderer/pepper/pepper_webplugin_impl.cc
index a3bca36..e32ae38 100644
--- a/content/renderer/pepper/ppapi_webplugin_impl.cc
+++ b/content/renderer/pepper/pepper_webplugin_impl.cc
@@ -2,16 +2,17 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/renderer/pepper/ppapi_webplugin_impl.h"
+#include "content/renderer/pepper/pepper_webplugin_impl.h"
 
 #include <cmath>
 
 #include "base/debug/crash_logging.h"
 #include "base/message_loop/message_loop.h"
+#include "content/public/common/page_zoom.h"
 #include "content/renderer/pepper/message_channel.h"
 #include "content/renderer/pepper/npobject_var.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/plugin_module.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "ppapi/shared_impl/ppapi_globals.h"
 #include "ppapi/shared_impl/var_tracker.h"
 #include "third_party/WebKit/public/platform/WebPoint.h"
@@ -26,7 +27,6 @@
 #include "third_party/WebKit/public/web/WebPluginParams.h"
 #include "third_party/WebKit/public/web/WebPrintParams.h"
 #include "third_party/WebKit/public/web/WebPrintScalingOption.h"
-#include "third_party/WebKit/public/web/WebView.h"
 #include "url/gurl.h"
 
 using ppapi::NPObjectVar;
@@ -41,25 +41,23 @@
 using WebKit::WebString;
 using WebKit::WebURL;
 using WebKit::WebVector;
-using WebKit::WebView;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
-struct WebPluginImpl::InitData {
+struct PepperWebPluginImpl::InitData {
   scoped_refptr<PluginModule> module;
   base::WeakPtr<PluginDelegate> delegate;
-  base::WeakPtr<content::RenderView> render_view;
+  base::WeakPtr<RenderView> render_view;
   std::vector<std::string> arg_names;
   std::vector<std::string> arg_values;
   GURL url;
 };
 
-WebPluginImpl::WebPluginImpl(
+PepperWebPluginImpl::PepperWebPluginImpl(
     PluginModule* plugin_module,
     const WebPluginParams& params,
     const base::WeakPtr<PluginDelegate>& plugin_delegate,
-    const base::WeakPtr<content::RenderView>& render_view)
+    const base::WeakPtr<RenderView>& render_view)
     : init_data_(new InitData()),
       full_frame_(params.loadManually),
       instance_object_(PP_MakeUndefined()),
@@ -78,14 +76,14 @@
   base::debug::SetCrashKeyValue("subresource_url", init_data_->url.spec());
 }
 
-WebPluginImpl::~WebPluginImpl() {
+PepperWebPluginImpl::~PepperWebPluginImpl() {
 }
 
-WebKit::WebPluginContainer* WebPluginImpl::container() const {
+WebKit::WebPluginContainer* PepperWebPluginImpl::container() const {
   return container_;
 }
 
-bool WebPluginImpl::initialize(WebPluginContainer* container) {
+bool PepperWebPluginImpl::initialize(WebPluginContainer* container) {
   // The plugin delegate may have gone away.
   if (!init_data_->delegate.get())
     return false;
@@ -121,7 +119,7 @@
   return true;
 }
 
-void WebPluginImpl::destroy() {
+void PepperWebPluginImpl::destroy() {
   // Tell |container_| to clear references to this plugin's script objects.
   if (container_)
     container_->clearScriptObjects();
@@ -136,7 +134,7 @@
   base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
 }
 
-NPObject* WebPluginImpl::scriptableObject() {
+NPObject* PepperWebPluginImpl::scriptableObject() {
   // Call through the plugin to get its instance object. The plugin should pass
   // us a reference which we release in destroy().
   if (instance_object_.type == PP_VARTYPE_UNDEFINED)
@@ -158,20 +156,20 @@
   return message_channel_np_object;
 }
 
-NPP WebPluginImpl::pluginNPP() {
+NPP PepperWebPluginImpl::pluginNPP() {
   return instance_->instanceNPP();
 }
 
-bool WebPluginImpl::getFormValue(WebString& value) {
+bool PepperWebPluginImpl::getFormValue(WebString& value) {
   return false;
 }
 
-void WebPluginImpl::paint(WebCanvas* canvas, const WebRect& rect) {
+void PepperWebPluginImpl::paint(WebCanvas* canvas, const WebRect& rect) {
   if (!instance_->FlashIsFullscreenOrPending())
     instance_->Paint(canvas, plugin_rect_, rect);
 }
 
-void WebPluginImpl::updateGeometry(
+void PepperWebPluginImpl::updateGeometry(
     const WebRect& window_rect,
     const WebRect& clip_rect,
     const WebVector<WebRect>& cut_outs_rects,
@@ -185,124 +183,124 @@
   }
 }
 
-void WebPluginImpl::updateFocus(bool focused) {
+void PepperWebPluginImpl::updateFocus(bool focused) {
   instance_->SetWebKitFocus(focused);
 }
 
-void WebPluginImpl::updateVisibility(bool visible) {
+void PepperWebPluginImpl::updateVisibility(bool visible) {
 }
 
-bool WebPluginImpl::acceptsInputEvents() {
+bool PepperWebPluginImpl::acceptsInputEvents() {
   return true;
 }
 
-bool WebPluginImpl::handleInputEvent(const WebKit::WebInputEvent& event,
-                                     WebKit::WebCursorInfo& cursor_info) {
+bool PepperWebPluginImpl::handleInputEvent(const WebKit::WebInputEvent& event,
+                                           WebKit::WebCursorInfo& cursor_info) {
   if (instance_->FlashIsFullscreenOrPending())
     return false;
   return instance_->HandleInputEvent(event, &cursor_info);
 }
 
-void WebPluginImpl::didReceiveResponse(
+void PepperWebPluginImpl::didReceiveResponse(
     const WebKit::WebURLResponse& response) {
   DCHECK(!instance_->document_loader());
   instance_->HandleDocumentLoad(response);
 }
 
-void WebPluginImpl::didReceiveData(const char* data, int data_length) {
+void PepperWebPluginImpl::didReceiveData(const char* data, int data_length) {
   WebKit::WebURLLoaderClient* document_loader = instance_->document_loader();
   if (document_loader)
     document_loader->didReceiveData(NULL, data, data_length, 0);
 }
 
-void WebPluginImpl::didFinishLoading() {
+void PepperWebPluginImpl::didFinishLoading() {
   WebKit::WebURLLoaderClient* document_loader = instance_->document_loader();
   if (document_loader)
     document_loader->didFinishLoading(NULL, 0.0);
 }
 
-void WebPluginImpl::didFailLoading(const WebKit::WebURLError& error) {
+void PepperWebPluginImpl::didFailLoading(const WebKit::WebURLError& error) {
   WebKit::WebURLLoaderClient* document_loader = instance_->document_loader();
   if (document_loader)
     document_loader->didFail(NULL, error);
 }
 
-void WebPluginImpl::didFinishLoadingFrameRequest(const WebKit::WebURL& url,
-                                                 void* notify_data) {
+void PepperWebPluginImpl::didFinishLoadingFrameRequest(
+    const WebKit::WebURL& url,
+    void* notify_data) {
 }
 
-void WebPluginImpl::didFailLoadingFrameRequest(
+void PepperWebPluginImpl::didFailLoadingFrameRequest(
     const WebKit::WebURL& url,
     void* notify_data,
     const WebKit::WebURLError& error) {
 }
 
-bool WebPluginImpl::hasSelection() const {
+bool PepperWebPluginImpl::hasSelection() const {
   return !selectionAsText().isEmpty();
 }
 
-WebString WebPluginImpl::selectionAsText() const {
+WebString PepperWebPluginImpl::selectionAsText() const {
   return instance_->GetSelectedText(false);
 }
 
-WebString WebPluginImpl::selectionAsMarkup() const {
+WebString PepperWebPluginImpl::selectionAsMarkup() const {
   return instance_->GetSelectedText(true);
 }
 
-WebURL WebPluginImpl::linkAtPosition(const WebPoint& position) const {
+WebURL PepperWebPluginImpl::linkAtPosition(const WebPoint& position) const {
   return GURL(instance_->GetLinkAtPosition(position));
 }
 
-void WebPluginImpl::setZoomLevel(double level, bool text_only) {
-  instance_->Zoom(WebView::zoomLevelToZoomFactor(level), text_only);
+void PepperWebPluginImpl::setZoomLevel(double level, bool text_only) {
+  instance_->Zoom(content::ZoomLevelToZoomFactor(level), text_only);
 }
 
-bool WebPluginImpl::startFind(const WebKit::WebString& search_text,
-                              bool case_sensitive,
-                              int identifier) {
+bool PepperWebPluginImpl::startFind(const WebKit::WebString& search_text,
+                                    bool case_sensitive,
+                                    int identifier) {
   return instance_->StartFind(search_text, case_sensitive, identifier);
 }
 
-void WebPluginImpl::selectFindResult(bool forward) {
+void PepperWebPluginImpl::selectFindResult(bool forward) {
   instance_->SelectFindResult(forward);
 }
 
-void WebPluginImpl::stopFind() {
+void PepperWebPluginImpl::stopFind() {
   instance_->StopFind();
 }
 
-bool WebPluginImpl::supportsPaginatedPrint() {
+bool PepperWebPluginImpl::supportsPaginatedPrint() {
   return instance_->SupportsPrintInterface();
 }
 
-bool WebPluginImpl::isPrintScalingDisabled() {
+bool PepperWebPluginImpl::isPrintScalingDisabled() {
   return instance_->IsPrintScalingDisabled();
 }
 
-int WebPluginImpl::printBegin(const WebPrintParams& print_params) {
+int PepperWebPluginImpl::printBegin(const WebPrintParams& print_params) {
   return instance_->PrintBegin(print_params);
 }
 
-bool WebPluginImpl::printPage(int page_number,
-                              WebKit::WebCanvas* canvas) {
+bool PepperWebPluginImpl::printPage(int page_number,
+                                    WebKit::WebCanvas* canvas) {
   return instance_->PrintPage(page_number, canvas);
 }
 
-void WebPluginImpl::printEnd() {
+void PepperWebPluginImpl::printEnd() {
   return instance_->PrintEnd();
 }
 
-bool WebPluginImpl::canRotateView() {
+bool PepperWebPluginImpl::canRotateView() {
   return instance_->CanRotateView();
 }
 
-void WebPluginImpl::rotateView(RotationType type) {
+void PepperWebPluginImpl::rotateView(RotationType type) {
   instance_->RotateView(type);
 }
 
-bool WebPluginImpl::isPlaceholder() {
+bool PepperWebPluginImpl::isPlaceholder() {
   return false;
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/ppapi_webplugin_impl.h b/content/renderer/pepper/pepper_webplugin_impl.h
similarity index 80%
rename from content/renderer/pepper/ppapi_webplugin_impl.h
rename to content/renderer/pepper/pepper_webplugin_impl.h
index ed26b75..11bd750 100644
--- a/content/renderer/pepper/ppapi_webplugin_impl.h
+++ b/content/renderer/pepper/pepper_webplugin_impl.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_RENDERER_PEPPER_PPAPI_WEBPLUGIN_IMPL_H_
-#define CONTENT_RENDERER_PEPPER_PPAPI_WEBPLUGIN_IMPL_H_
+#ifndef CONTENT_RENDERER_PEPPER_PPEPPER_WEBPLUGIN_IMPL_H_
+#define CONTENT_RENDERER_PEPPER_PPEPPER_WEBPLUGIN_IMPL_H_
 
 #include <string>
 #include <vector>
@@ -26,22 +26,21 @@
 struct WebPrintParams;
 }
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
+class PepperPluginInstanceImpl;
 class PluginDelegate;
-class PluginInstanceImpl;
 class PluginModule;
 class PPB_URLLoader_Impl;
 
-class WebPluginImpl : public WebKit::WebPlugin {
+class PepperWebPluginImpl : public WebKit::WebPlugin {
  public:
-  WebPluginImpl(PluginModule* module,
-                const WebKit::WebPluginParams& params,
-                const base::WeakPtr<PluginDelegate>& plugin_delegate,
-                const base::WeakPtr<content::RenderView>& render_view);
+  PepperWebPluginImpl(PluginModule* module,
+                      const WebKit::WebPluginParams& params,
+                      const base::WeakPtr<PluginDelegate>& plugin_delegate,
+                      const base::WeakPtr<RenderView>& render_view);
 
-  PluginInstanceImpl* instance() { return instance_.get(); }
+  PepperPluginInstanceImpl* instance() { return instance_.get(); }
 
   // WebKit::WebPlugin implementation.
   virtual WebKit::WebPluginContainer* container() const;
@@ -92,24 +91,23 @@
   virtual bool isPlaceholder() OVERRIDE;
 
  private:
-  friend class base::DeleteHelper<WebPluginImpl>;
+  friend class base::DeleteHelper<PepperWebPluginImpl>;
 
-  virtual ~WebPluginImpl();
+  virtual ~PepperWebPluginImpl();
   struct InitData;
 
   scoped_ptr<InitData> init_data_;  // Cleared upon successful initialization.
   // True if the instance represents the entire document in a frame instead of
   // being an embedded resource.
   bool full_frame_;
-  scoped_refptr<PluginInstanceImpl> instance_;
+  scoped_refptr<PepperPluginInstanceImpl> instance_;
   gfx::Rect plugin_rect_;
   PP_Var instance_object_;
   WebKit::WebPluginContainer* container_;
 
-  DISALLOW_COPY_AND_ASSIGN(WebPluginImpl);
+  DISALLOW_COPY_AND_ASSIGN(PepperWebPluginImpl);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
-#endif  // CONTENT_RENDERER_PEPPER_PPAPI_WEBPLUGIN_IMPL_H_
+#endif  // CONTENT_RENDERER_PEPPER_PPEPPER_WEBPLUGIN_IMPL_H_
diff --git a/content/renderer/pepper/plugin_delegate.h b/content/renderer/pepper/plugin_delegate.h
index e5f2118..deb5d04 100644
--- a/content/renderer/pepper/plugin_delegate.h
+++ b/content/renderer/pepper/plugin_delegate.h
@@ -13,7 +13,7 @@
 #include "base/memory/shared_memory.h"
 #include "base/message_loop/message_loop_proxy.h"
 #include "base/platform_file.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/sync_socket.h"
 #include "base/time/time.h"
 #include "content/common/content_export.h"
@@ -105,13 +105,11 @@
 class NetworkListObserver;
 }  // namespace webkit_glue
 
-namespace webkit {
-
-namespace ppapi {
+namespace content {
 
 class FileIO;
 class FullscreenContainer;
-class PluginInstanceImpl;
+class PepperPluginInstanceImpl;
 class PluginModule;
 class PPB_Broker_Impl;
 class PPB_Flash_Menu_Impl;
@@ -183,7 +181,7 @@
     // to clear the existing device. Returns true on success. In this case, a
     // repaint of the page will also be scheduled. Failure means that the device
     // is already bound to a different instance, and nothing will happen.
-    virtual bool BindToInstance(PluginInstanceImpl* new_instance) = 0;
+    virtual bool BindToInstance(PepperPluginInstanceImpl* new_instance) = 0;
 
     // Paints the current backing store to the web page.
     virtual void Paint(WebKit::WebCanvas* canvas,
@@ -334,27 +332,26 @@
     // When there are no more references, this renderer's dispatcher is
     // destroyed, allowing the broker to shutdown if appropriate.
     // Callers should not reference this object after calling Disconnect().
-    virtual void Disconnect(webkit::ppapi::PPB_Broker_Impl* client) = 0;
+    virtual void Disconnect(PPB_Broker_Impl* client) = 0;
 
    protected:
     virtual ~Broker() {}
   };
 
   // Notification that the given plugin is focused or unfocused.
-  virtual void PluginFocusChanged(webkit::ppapi::PluginInstanceImpl* instance,
+  virtual void PluginFocusChanged(PepperPluginInstanceImpl* instance,
                                   bool focused) = 0;
   // Notification that the text input status of the given plugin is changed.
   virtual void PluginTextInputTypeChanged(
-      webkit::ppapi::PluginInstanceImpl* instance) = 0;
+      PepperPluginInstanceImpl* instance) = 0;
   // Notification that the caret position in the given plugin is changed.
   virtual void PluginCaretPositionChanged(
-      webkit::ppapi::PluginInstanceImpl* instance) = 0;
+      PepperPluginInstanceImpl* instance) = 0;
   // Notification that the plugin requested to cancel the current composition.
   virtual void PluginRequestedCancelComposition(
-      webkit::ppapi::PluginInstanceImpl* instance) = 0;
+      PepperPluginInstanceImpl* instance) = 0;
   // Notification that the text selection in the given plugin is changed.
-  virtual void PluginSelectionChanged(
-      webkit::ppapi::PluginInstanceImpl* instance) = 0;
+  virtual void PluginSelectionChanged(PepperPluginInstanceImpl* instance) = 0;
   // Requests simulating IME events for testing purpose.
   virtual void SimulateImeSetComposition(
       const base::string16& text,
@@ -366,19 +363,19 @@
   // Notification that the given plugin has crashed. When a plugin crashes, all
   // instances associated with that plugin will notify that they've crashed via
   // this function.
-  virtual void PluginCrashed(PluginInstanceImpl* instance) = 0;
+  virtual void PluginCrashed(PepperPluginInstanceImpl* instance) = 0;
 
   // Indicates that the given instance has been created.
-  virtual void InstanceCreated(PluginInstanceImpl* instance) = 0;
+  virtual void InstanceCreated(PepperPluginInstanceImpl* instance) = 0;
 
   // Indicates that the given instance is being destroyed. This is called from
   // the destructor, so it's important that the instance is not dereferenced
   // from this call.
-  virtual void InstanceDeleted(PluginInstanceImpl* instance) = 0;
+  virtual void InstanceDeleted(PepperPluginInstanceImpl* instance) = 0;
 
   // Creates the resource creation API for the given instance.
   virtual scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>
-      CreateResourceCreationAPI(PluginInstanceImpl* instance) = 0;
+      CreateResourceCreationAPI(PepperPluginInstanceImpl* instance) = 0;
 
   // Returns a pointer (ownership not transferred) to the bitmap to paint the
   // sad plugin screen with. Returns NULL on failure.
@@ -393,7 +390,7 @@
   virtual PlatformImage2D* CreateImage2D(int width, int height) = 0;
 
   // Returns the internal PlatformGraphics2D implementation.
-  virtual PlatformGraphics2D* GetGraphics2D(PluginInstanceImpl* instance,
+  virtual PlatformGraphics2D* GetGraphics2D(PepperPluginInstanceImpl* instance,
                                             PP_Resource graphics_2d) = 0;
 
   // The caller will own the pointer returned from this.
@@ -441,7 +438,7 @@
   // BrokerConnected has been called.
   // The caller is responsible for calling Disconnect() on the returned pointer
   // to clean up the corresponding resources allocated during this call.
-  virtual Broker* ConnectToBroker(webkit::ppapi::PPB_Broker_Impl* client) = 0;
+  virtual Broker* ConnectToBroker(PPB_Broker_Impl* client) = 0;
 
   // Notifies that the number of find results has changed.
   virtual void NumberOfFindResultsChanged(int identifier,
@@ -524,14 +521,6 @@
       const ReadDirectoryCallback& success_callback,
       const StatusCallback& error_callback) = 0;
 
-  // For quota handlings for FileIO API.
-  typedef base::Callback<void (int64)> AvailableSpaceCallback;
-  virtual void QueryAvailableSpace(const GURL& origin,
-                                   quota::StorageType type,
-                                   const AvailableSpaceCallback& callback) = 0;
-  virtual void WillUpdateFile(const GURL& file_path) = 0;
-  virtual void DidUpdateFile(const GURL& file_path, int64_t delta) = 0;
-
   // Synchronously returns the platform file path for a filesystem URL.
   virtual void SyncGetFileSystemPlatformPath(const GURL& url,
                                              base::FilePath* platform_path) = 0;
@@ -589,7 +578,7 @@
   // Create a fullscreen container for a plugin instance. This effectively
   // switches the plugin to fullscreen.
   virtual FullscreenContainer* CreateFullscreenContainer(
-      PluginInstanceImpl* instance) = 0;
+      PepperPluginInstanceImpl* instance) = 0;
 
   // Gets the size of the screen. The fullscreen window will be created at that
   // size.
@@ -613,7 +602,7 @@
   // possible. If true is returned then the lock is pending. Success or
   // failure will be delivered asynchronously via
   // PluginInstance::OnLockMouseACK().
-  virtual bool LockMouse(PluginInstanceImpl* instance) = 0;
+  virtual bool LockMouse(PepperPluginInstanceImpl* instance) = 0;
 
   // Unlocks the mouse if |instance| currently owns the mouse lock. Whenever an
   // plugin instance has lost the mouse lock, it will be notified by
@@ -621,19 +610,19 @@
   // the only cause of losing mouse lock. For example, a user may press the Esc
   // key to quit the mouse lock mode, which also results in an OnMouseLockLost()
   // call to the current mouse lock owner.
-  virtual void UnlockMouse(PluginInstanceImpl* instance) = 0;
+  virtual void UnlockMouse(PepperPluginInstanceImpl* instance) = 0;
 
   // Returns true iff |instance| currently owns the mouse lock.
-  virtual bool IsMouseLocked(PluginInstanceImpl* instance) = 0;
+  virtual bool IsMouseLocked(PepperPluginInstanceImpl* instance) = 0;
 
   // Notifies that |instance| has changed the cursor.
   // This will update the cursor appearance if it is currently over the plugin
   // instance.
-  virtual void DidChangeCursor(PluginInstanceImpl* instance,
+  virtual void DidChangeCursor(PepperPluginInstanceImpl* instance,
                                const WebKit::WebCursorInfo& cursor) = 0;
 
   // Notifies that |instance| has received a mouse event.
-  virtual void DidReceiveMouseEvent(PluginInstanceImpl* instance) = 0;
+  virtual void DidReceiveMouseEvent(PepperPluginInstanceImpl* instance) = 0;
 
   // Determines if the browser entered fullscreen mode.
   virtual bool IsInFullscreenMode() = 0;
@@ -672,12 +661,12 @@
   //
   // The loader object should set itself on the PluginInstance as the document
   // loader using set_document_loader.
-  virtual void HandleDocumentLoad(PluginInstanceImpl* instance,
+  virtual void HandleDocumentLoad(PepperPluginInstanceImpl* instance,
                                   const WebKit::WebURLResponse& response) = 0;
 
   // Sets up the renderer host and out-of-process proxy for an external plugin
   // module. Returns the renderer host, or NULL if it couldn't be created.
-  virtual content::RendererPpapiHost* CreateExternalPluginModule(
+  virtual RendererPpapiHost* CreateExternalPluginModule(
       scoped_refptr<PluginModule> module,
       const base::FilePath& path,
       ::ppapi::PpapiPermissions permissions,
@@ -686,7 +675,6 @@
       int plugin_child_id) = 0;
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_H_
diff --git a/content/renderer/pepper/plugin_module.cc b/content/renderer/pepper/plugin_module.cc
index 44253b2..43af78c 100644
--- a/content/renderer/pepper/plugin_module.cc
+++ b/content/renderer/pepper/plugin_module.cc
@@ -13,11 +13,11 @@
 #include "base/message_loop/message_loop.h"
 #include "base/message_loop/message_loop_proxy.h"
 #include "base/time/time.h"
+#include "content/public/renderer/content_renderer_client.h"
 #include "content/renderer/pepper/common.h"
 #include "content/renderer/pepper/host_globals.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/pepper_plugin_registry.h"
-#include "content/renderer/pepper/ppapi_interface_factory.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "content/renderer/pepper/ppb_gpu_blacklist_private_impl.h"
 #include "content/renderer/pepper/ppb_image_data_impl.h"
 #include "content/renderer/pepper/ppb_proxy_impl.h"
@@ -141,8 +141,7 @@
 using ppapi::thunk::PPB_Graphics2D_API;
 using ppapi::thunk::PPB_InputEvent_API;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 
@@ -155,7 +154,7 @@
 // TODO(raymes): I'm not sure if it is completely necessary to leak the
 // HostGlobals. Figure out the shutdown sequence and find a way to do this
 // more elegantly.
-webkit::ppapi::HostGlobals* host_globals = NULL;
+HostGlobals* host_globals = NULL;
 
 // Maintains all currently loaded plugin libs for validating PP_Module
 // identifiers.
@@ -240,7 +239,8 @@
 }
 
 void SimulateInputEvent(PP_Instance instance, PP_Resource input_event) {
-  PluginInstanceImpl* plugin_instance = host_globals->GetInstance(instance);
+  PepperPluginInstanceImpl* plugin_instance =
+      host_globals->GetInstance(instance);
   if (!plugin_instance)
     return;
 
@@ -253,7 +253,8 @@
 }
 
 PP_Var GetDocumentURL(PP_Instance instance, PP_URLComponents_Dev* components) {
-  PluginInstanceImpl* plugin_instance = host_globals->GetInstance(instance);
+  PepperPluginInstanceImpl* plugin_instance =
+      host_globals->GetInstance(instance);
   if (!plugin_instance)
     return PP_MakeUndefined();
   return plugin_instance->GetDocumentURL(instance, components);
@@ -291,7 +292,7 @@
 const void* InternalGetInterface(const char* name) {
   // Allow custom interface factories first stab at the GetInterface call.
   const void* custom_interface =
-      PpapiInterfaceFactoryManager::GetInstance()->GetInterface(name);
+      GetContentClient()->renderer()->CreatePPAPIInterface(name);
   if (custom_interface)
     return custom_interface;
 
@@ -343,9 +344,9 @@
 // given structure. Returns true on success.
 bool LoadEntryPointsFromLibrary(
     const base::NativeLibrary& library,
-    content::PepperPluginInfo::EntryPoints* entry_points) {
+    PepperPluginInfo::EntryPoints* entry_points) {
   entry_points->get_interface =
-      reinterpret_cast<content::PepperPluginInfo::GetInterfaceFunc>(
+      reinterpret_cast<PepperPluginInfo::GetInterfaceFunc>(
           base::GetFunctionPointerFromNativeLibrary(library,
                                                     "PPP_GetInterface"));
   if (!entry_points->get_interface) {
@@ -354,7 +355,7 @@
   }
 
   entry_points->initialize_module =
-      reinterpret_cast<content::PepperPluginInfo::PPP_InitializeModuleFunc>(
+      reinterpret_cast<PepperPluginInfo::PPP_InitializeModuleFunc>(
           base::GetFunctionPointerFromNativeLibrary(library,
                                                     "PPP_InitializeModule"));
   if (!entry_points->initialize_module) {
@@ -365,7 +366,7 @@
   // It's okay for PPP_ShutdownModule to not be defined and shutdown_module to
   // be NULL.
   entry_points->shutdown_module =
-      reinterpret_cast<content::PepperPluginInfo::PPP_ShutdownModuleFunc>(
+      reinterpret_cast<PepperPluginInfo::PPP_ShutdownModuleFunc>(
           base::GetFunctionPointerFromNativeLibrary(library,
                                                     "PPP_ShutdownModule"));
 
@@ -426,7 +427,7 @@
   if (!is_crashed_) {
     // When the plugin crashes, we immediately tell the lifetime delegate that
     // we're gone, so we don't want to tell it again.
-    content::PepperPluginRegistry::GetInstance()->PluginModuleDead(this);
+    PepperPluginRegistry::GetInstance()->PluginModuleDead(this);
   }
 
   // Don't add stuff here, the two notifications that the module object has
@@ -444,7 +445,7 @@
 }
 
 bool PluginModule::InitAsInternalPlugin(
-    const content::PepperPluginInfo::EntryPoints& entry_points) {
+    const PepperPluginInfo::EntryPoints& entry_points) {
   if (InitializeModule(entry_points)) {
     entry_points_ = entry_points;
     return true;
@@ -457,7 +458,7 @@
   if (!library)
     return false;
 
-  content::PepperPluginInfo::EntryPoints entry_points;
+  PepperPluginInfo::EntryPoints entry_points;
 
   if (!LoadEntryPointsFromLibrary(library, &entry_points) ||
       !InitializeModule(entry_points)) {
@@ -487,7 +488,7 @@
 }
 
 PP_ExternalPluginResult PluginModule::InitAsProxiedExternalPlugin(
-    PluginInstanceImpl* instance) {
+    PepperPluginInstanceImpl* instance) {
   DCHECK(out_of_process_proxy_.get());
   // InitAsProxied (for the trusted/out-of-process case) initializes only the
   // module, and one or more instances are added later. In this case, the
@@ -522,8 +523,7 @@
 }
 
 // static
-content::PepperPluginInfo::GetInterfaceFunc
-    PluginModule::GetLocalGetInterfaceFunc() {
+PepperPluginInfo::GetInterfaceFunc PluginModule::GetLocalGetInterfaceFunc() {
   return &GetInterface;
 }
 
@@ -532,12 +532,12 @@
   return !!InternalGetInterface(name);
 }
 
-PluginInstanceImpl* PluginModule::CreateInstance(
+PepperPluginInstanceImpl* PluginModule::CreateInstance(
     PluginDelegate* delegate,
-    content::RenderView* render_view,
+    RenderView* render_view,
     WebKit::WebPluginContainer* container,
     const GURL& plugin_url) {
-  PluginInstanceImpl* instance = PluginInstanceImpl::Create(
+  PepperPluginInstanceImpl* instance = PepperPluginInstanceImpl::Create(
       delegate, render_view, this, container, plugin_url);
   if (!instance) {
     LOG(WARNING) << "Plugin doesn't support instance interface, failing.";
@@ -548,7 +548,7 @@
   return instance;
 }
 
-PluginInstanceImpl* PluginModule::GetSomeInstance() const {
+PepperPluginInstanceImpl* PluginModule::GetSomeInstance() const {
   // This will generally crash later if there is not actually any instance to
   // return, so we force a crash now to make bugs easier to track down.
   CHECK(!instances_.empty());
@@ -565,11 +565,11 @@
   return entry_points_.get_interface(name);
 }
 
-void PluginModule::InstanceCreated(PluginInstanceImpl* instance) {
+void PluginModule::InstanceCreated(PepperPluginInstanceImpl* instance) {
   instances_.insert(instance);
 }
 
-void PluginModule::InstanceDeleted(PluginInstanceImpl* instance) {
+void PluginModule::InstanceDeleted(PepperPluginInstanceImpl* instance) {
   if (out_of_process_proxy_)
     out_of_process_proxy_->RemoveInstance(instance->pp_instance());
   instances_.erase(instance);
@@ -588,7 +588,7 @@
        i != instances_.end(); ++i)
     (*i)->InstanceCrashed();
 
-  content::PepperPluginRegistry::GetInstance()->PluginModuleDead(this);
+  PepperPluginRegistry::GetInstance()->PluginModuleDead(this);
 }
 
 void PluginModule::SetReserveInstanceIDCallback(
@@ -619,7 +619,7 @@
 }
 
 bool PluginModule::InitializeModule(
-    const content::PepperPluginInfo::EntryPoints& entry_points) {
+    const PepperPluginInfo::EntryPoints& entry_points) {
   DCHECK(!out_of_process_proxy_.get()) << "Don't call for proxied modules.";
   DCHECK(entry_points.initialize_module != NULL);
   int retval = entry_points.initialize_module(pp_module(), &GetInterface);
@@ -630,5 +630,4 @@
   return true;
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/plugin_module.h b/content/renderer/pepper/plugin_module.h
index c4f3527..05835f5 100644
--- a/content/renderer/pepper/plugin_module.h
+++ b/content/renderer/pepper/plugin_module.h
@@ -15,7 +15,7 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/weak_ptr.h"
 #include "base/native_library.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/common/content_export.h"
 #include "content/public/common/pepper_plugin_info.h"
 #include "content/renderer/pepper/plugin_delegate.h"
@@ -44,16 +44,15 @@
 class WebPluginContainer;
 }  // namespace WebKit
 
-namespace webkit {
-namespace ppapi {
-
+namespace content {
+  
+class PepperPluginInstanceImpl;
 class PluginDelegate;
-class PluginInstanceImpl;
 
 // Represents one plugin library loaded into one renderer. This library may
 // have multiple instances.
 //
-// Note: to get from a PP_Instance to a PluginInstance*, use the
+// Note: to get from a PP_Instance to a PepperPluginInstance*, use the
 // ResourceTracker.
 class CONTENT_EXPORT PluginModule :
     public base::RefCounted<PluginModule>,
@@ -67,7 +66,7 @@
     virtual ~EmbedderState() {}
   };
 
-  typedef std::set<PluginInstanceImpl*> PluginInstanceSet;
+  typedef std::set<PepperPluginInstanceImpl*> PluginInstanceSet;
 
   // You must call one of the Init functions after the constructor to create a
   // module of the type you desire.
@@ -90,8 +89,7 @@
   // Initializes this module as an internal plugin with the given entrypoints.
   // This is used for "plugins" compiled into Chrome. Returns true on success.
   // False means that the plugin can not be used.
-  bool InitAsInternalPlugin(
-      const content::PepperPluginInfo::EntryPoints& entry_points);
+  bool InitAsInternalPlugin(const PepperPluginInfo::EntryPoints& entry_points);
 
   // Initializes this module using the given library path as the plugin.
   // Returns true on success. False means that the plugin can not be used.
@@ -111,7 +109,7 @@
   // Returns a result code indicating whether the proxy started successfully or
   // there was an error.
   PP_ExternalPluginResult InitAsProxiedExternalPlugin(
-      PluginInstanceImpl* instance);
+      PepperPluginInstanceImpl* instance);
 
   bool IsProxied() const;
 
@@ -130,13 +128,13 @@
 
   // Returns a pointer to the local GetInterface function for retrieving
   // PPB interfaces.
-  static content::PepperPluginInfo::GetInterfaceFunc GetLocalGetInterfaceFunc();
+  static PepperPluginInfo::GetInterfaceFunc GetLocalGetInterfaceFunc();
 
   // Returns whether an interface is supported. This method can be called from
   // the browser process and used for interface matching before plugin
   // registration.
-  // NOTE: those custom interfaces provided by PpapiInterfaceFactoryManager
-  // will not be considered when called on the browser process.
+  // NOTE: those custom interfaces provided by ContentRendererClient will not be
+  // considered when called on the browser process.
   static bool SupportsInterface(const char* name);
 
   // Returns the module handle. This may be used before Init() is called (the
@@ -147,16 +145,17 @@
   const base::FilePath& path() const { return path_; }
   const ::ppapi::PpapiPermissions& permissions() const { return permissions_; }
 
-  PluginInstanceImpl* CreateInstance(PluginDelegate* delegate,
-                                     content::RenderView* render_view,
-                                     WebKit::WebPluginContainer* container,
-                                     const GURL& plugin_url);
+  PepperPluginInstanceImpl* CreateInstance(
+      PluginDelegate* delegate,
+      RenderView* render_view,
+      WebKit::WebPluginContainer* container,
+      const GURL& plugin_url);
 
   // Returns "some" plugin instance associated with this module. This is not
   // guaranteed to be any one in particular. This is normally used to execute
   // callbacks up to the browser layer that are not inherently per-instance,
   // but the delegate lives only on the plugin instance so we need one of them.
-  PluginInstanceImpl* GetSomeInstance() const;
+  PepperPluginInstanceImpl* GetSomeInstance() const;
 
   const PluginInstanceSet& GetAllInstances() const { return instances_; }
 
@@ -167,8 +166,8 @@
   // This module is associated with a set of instances. The PluginInstance
   // object declares its association with this module in its destructor and
   // releases us in its destructor.
-  void InstanceCreated(PluginInstanceImpl* instance);
-  void InstanceDeleted(PluginInstanceImpl* instance);
+  void InstanceCreated(PepperPluginInstanceImpl* instance);
+  void InstanceDeleted(PepperPluginInstanceImpl* instance);
 
   scoped_refptr< ::ppapi::CallbackTracker> GetCallbackTracker();
 
@@ -207,8 +206,7 @@
   // Calls the InitializeModule entrypoint. The entrypoint must have been
   // set and the plugin must not be out of process (we don't maintain
   // entrypoints in that case).
-  bool InitializeModule(
-      const content::PepperPluginInfo::EntryPoints& entry_points);
+  bool InitializeModule(const PepperPluginInfo::EntryPoints& entry_points);
 
   // See EmbedderState above.
   scoped_ptr<EmbedderState> embedder_state_;
@@ -244,7 +242,7 @@
   // Contains pointers to the entry points of the actual plugin implementation.
   // These will be NULL for out-of-process plugins, which is indicated by the
   // presence of the out_of_process_proxy_ value.
-  content::PepperPluginInfo::EntryPoints entry_points_;
+  PepperPluginInfo::EntryPoints entry_points_;
 
   // The name and file location of the module.
   const std::string name_;
@@ -261,7 +259,6 @@
   DISALLOW_COPY_AND_ASSIGN(PluginModule);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PLUGIN_MODULE_H_
diff --git a/content/renderer/pepper/plugin_object.cc b/content/renderer/pepper/plugin_object.cc
index 9955d0c..62346f5 100644
--- a/content/renderer/pepper/plugin_object.cc
+++ b/content/renderer/pepper/plugin_object.cc
@@ -10,8 +10,8 @@
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
 #include "content/renderer/pepper/npapi_glue.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/plugin_module.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "ppapi/c/dev/ppb_var_deprecated.h"
 #include "ppapi/c/dev/ppp_class_deprecated.h"
 #include "ppapi/c/pp_resource.h"
@@ -29,8 +29,7 @@
 using ppapi::Var;
 using WebKit::WebBindings;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 
@@ -83,8 +82,7 @@
   // object to ensure that it is not destroyed courtsey an incoming
   // ExecuteScript call which destroys the plugin module and in turn the
   // dispatcher.
-  scoped_refptr<webkit::ppapi::PluginModule> ref(
-      accessor.object()->instance()->module());
+  scoped_refptr<PluginModule> ref(accessor.object()->instance()->module());
 
   return result_converter.SetResult(accessor.object()->ppp_class()->Call(
       accessor.object()->ppp_class_data(), accessor.identifier(),
@@ -104,8 +102,7 @@
   // object to ensure that it is not destroyed courtsey an incoming
   // ExecuteScript call which destroys the plugin module and in turn the
   // dispatcher.
-  scoped_refptr<webkit::ppapi::PluginModule> ref(
-      obj->instance()->module());
+  scoped_refptr<PluginModule> ref(obj->instance()->module());
 
   result_converter.SetResult(obj->ppp_class()->Call(
       obj->ppp_class_data(), PP_MakeUndefined(), argc, args.array(),
@@ -265,7 +262,7 @@
   PluginObject* obj;
 };
 
-PluginObject::PluginObject(PluginInstanceImpl* instance,
+PluginObject::PluginObject(PepperPluginInstanceImpl* instance,
                            NPObjectWrapper* object_wrapper,
                            const PPP_Class_Deprecated* ppp_class,
                            void* ppp_class_data)
@@ -290,7 +287,7 @@
   instance_->RemovePluginObject(this);
 }
 
-PP_Var PluginObject::Create(PluginInstanceImpl* instance,
+PP_Var PluginObject::Create(PepperPluginInstanceImpl* instance,
                             const PPP_Class_Deprecated* ppp_class,
                             void* ppp_class_data) {
   // This will internally end up calling our AllocateObjectWrapper via the
@@ -355,6 +352,5 @@
   return wrapper;
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
diff --git a/content/renderer/pepper/plugin_object.h b/content/renderer/pepper/plugin_object.h
index c222e50..362979a 100644
--- a/content/renderer/pepper/plugin_object.h
+++ b/content/renderer/pepper/plugin_object.h
@@ -14,10 +14,9 @@
 typedef struct NPObject NPObject;
 typedef struct _NPVariant NPVariant;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
-class PluginInstanceImpl;
+class PepperPluginInstanceImpl;
 
 // A PluginObject is a JS-accessible object implemented by the plugin.
 //
@@ -29,11 +28,11 @@
 
   // Allocates a new PluginObject and returns it as a PP_Var with a
   // refcount of 1.
-  static PP_Var Create(PluginInstanceImpl* instance,
+  static PP_Var Create(PepperPluginInstanceImpl* instance,
                        const PPP_Class_Deprecated* ppp_class,
                        void* ppp_class_data);
 
-  PluginInstanceImpl* instance() const { return instance_; }
+  PepperPluginInstanceImpl* instance() const { return instance_; }
 
   const PPP_Class_Deprecated* ppp_class() { return ppp_class_; }
   void* ppp_class_data() { return ppp_class_data_; };
@@ -68,12 +67,12 @@
   //
   // The NPObjectWrapper (an NPObject) should already have the reference
   // incremented on it, and this class will take ownership of that reference.
-  PluginObject(PluginInstanceImpl* instance,
+  PluginObject(PepperPluginInstanceImpl* instance,
                NPObjectWrapper* object_wrapper,
                const PPP_Class_Deprecated* ppp_class,
                void* ppp_class_data);
 
-  PluginInstanceImpl* instance_;
+  PepperPluginInstanceImpl* instance_;
 
   // Holds a pointer to the NPObject wrapper backing the var. This class
   // derives from NPObject and we hold a reference to it, so it must be
@@ -89,7 +88,6 @@
   DISALLOW_COPY_AND_ASSIGN(PluginObject);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PLUGIN_OBJECT_H_
diff --git a/content/renderer/pepper/ppapi_interface_factory.cc b/content/renderer/pepper/ppapi_interface_factory.cc
deleted file mode 100644
index acb6858..0000000
--- a/content/renderer/pepper/ppapi_interface_factory.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/renderer/pepper/ppapi_interface_factory.h"
-
-#include <algorithm>
-
-#include "base/logging.h"
-
-namespace webkit {
-namespace ppapi {
-
-base::LazyInstance<PpapiInterfaceFactoryManager>
-    g_ppapi_interface_factory_manager = LAZY_INSTANCE_INITIALIZER;
-
-PpapiInterfaceFactoryManager::PpapiInterfaceFactoryManager() {
-}
-
-PpapiInterfaceFactoryManager::~PpapiInterfaceFactoryManager() {
-}
-
-void PpapiInterfaceFactoryManager::RegisterFactory(InterfaceFactory* factory) {
-  DCHECK(std::find(interface_factory_list_.begin(),
-                   interface_factory_list_.end(), factory) ==
-         interface_factory_list_.end());
-  interface_factory_list_.push_back(factory);
-}
-
-void PpapiInterfaceFactoryManager::UnregisterFactory(
-    InterfaceFactory* factory) {
-  FactoryList::iterator index =
-      std::find(interface_factory_list_.begin(), interface_factory_list_.end(),
-                factory);
-  if (index != interface_factory_list_.end())
-    interface_factory_list_.erase(index);
-}
-
-const void* PpapiInterfaceFactoryManager::GetInterface(
-    const std::string& interface_name) {
-  FactoryList::iterator index;
-
-  const void* ppapi_interface = NULL;
-
-  for (index = interface_factory_list_.begin();
-       index != interface_factory_list_.end();
-       ++index) {
-    ppapi_interface = (*index)(interface_name);
-    if (ppapi_interface)
-      break;
-  }
-  return ppapi_interface;
-}
-
-// static
-PpapiInterfaceFactoryManager* PpapiInterfaceFactoryManager::GetInstance() {
-  return &g_ppapi_interface_factory_manager.Get();
-}
-
-}  // namespace ppapi
-}  // namespace webkit
-
diff --git a/content/renderer/pepper/ppapi_interface_factory.h b/content/renderer/pepper/ppapi_interface_factory.h
deleted file mode 100644
index 6654f61..0000000
--- a/content/renderer/pepper/ppapi_interface_factory.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_RENDERER_PEPPER_PLUGIN_INTERFACE_FACTORY_H_
-#define CONTENT_RENDERER_PEPPER_PLUGIN_INTERFACE_FACTORY_H_
-
-#include <string>
-#include <vector>
-
-#include "base/basictypes.h"
-#include "base/lazy_instance.h"
-#include "content/common/content_export.h"
-
-namespace webkit {
-namespace ppapi {
-
-// This class provides functionality to manage custom PPAPI interface
-// factories.
-class PpapiInterfaceFactoryManager {
- public:
-  typedef const void* (InterfaceFactory)(const std::string& interface_name);
-
-  // Registers a custom PPAPI interface factory.
-  CONTENT_EXPORT void RegisterFactory(InterfaceFactory* factory);
-
-  // Unregisters the custom PPAPI interface factory passed in.
-  CONTENT_EXPORT void UnregisterFactory(InterfaceFactory* factory);
-
-  // Returns a pointer to the interface identified by the name passed in.
-  // Returns NULL if no factory handles this interface.
-  const void* GetInterface(const std::string& interface_name);
-
-  // Returns a pointer to the global instance of the
-  // PpapiInterfaceFactoryManager class.
-  CONTENT_EXPORT static PpapiInterfaceFactoryManager* GetInstance();
-
- private:
-  friend struct base::DefaultLazyInstanceTraits<PpapiInterfaceFactoryManager>;
-
-  PpapiInterfaceFactoryManager();
-  ~PpapiInterfaceFactoryManager();
-
-  typedef std::vector<InterfaceFactory*> FactoryList;
-
-  // List of registered factories.
-  FactoryList interface_factory_list_;
-
-  DISALLOW_COPY_AND_ASSIGN(PpapiInterfaceFactoryManager);
-};
-
-}  // namespace ppapi
-}  // namespace webkit
-
-#endif  // CONTENT_RENDERER_PEPPER_PLUGIN_INTERFACE_FACTORY_H_
-
diff --git a/content/renderer/pepper/ppapi_unittest.cc b/content/renderer/pepper/ppapi_unittest.cc
index e6edf94..2503072 100644
--- a/content/renderer/pepper/ppapi_unittest.cc
+++ b/content/renderer/pepper/ppapi_unittest.cc
@@ -8,16 +8,14 @@
 #include "content/renderer/pepper/gfx_conversion.h"
 #include "content/renderer/pepper/host_globals.h"
 #include "content/renderer/pepper/mock_plugin_delegate.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/plugin_module.h"
-#include "content/renderer/pepper/ppapi_interface_factory.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "ppapi/c/pp_var.h"
 #include "ppapi/c/ppp_instance.h"
 #include "ppapi/shared_impl/ppapi_globals.h"
 #include "ppapi/shared_impl/ppapi_permissions.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 
@@ -78,19 +76,19 @@
 
 void PpapiUnittest::SetUp() {
   message_loop_.reset(new base::MessageLoop());
-  delegate_.reset(NewPluginDelegate());
+  delegate_.reset(new MockPluginDelegate());
 
   // Initialize the mock module.
   module_ = new PluginModule("Mock plugin", base::FilePath(),
                              ::ppapi::PpapiPermissions());
   ::ppapi::PpapiGlobals::Get()->ResetMainThreadMessageLoopForTesting();
-  content::PepperPluginInfo::EntryPoints entry_points;
+  PepperPluginInfo::EntryPoints entry_points;
   entry_points.get_interface = &MockGetInterface;
   entry_points.initialize_module = &MockInitializeModule;
   ASSERT_TRUE(module_->InitAsInternalPlugin(entry_points));
 
   // Initialize the mock instance.
-  instance_ = PluginInstanceImpl::Create(
+  instance_ = PepperPluginInstanceImpl::Create(
       delegate_.get(), NULL, module(), NULL, GURL());
 }
 
@@ -101,10 +99,6 @@
   PluginModule::ResetHostGlobalsForTest();
 }
 
-MockPluginDelegate* PpapiUnittest::NewPluginDelegate() {
-  return new MockPluginDelegate;
-}
-
 const void* PpapiUnittest::GetMockInterface(const char* interface_name) const {
   if (strcmp(interface_name, PPP_INSTANCE_INTERFACE_1_0) == 0)
     return &mock_instance_interface;
@@ -123,47 +117,4 @@
   instance_->view_data_.clip_rect = instance_->view_data_.rect;
 }
 
-// Tests whether custom PPAPI interface factories are called when PPAPI
-// interfaces are requested.
-class PpapiCustomInterfaceFactoryTest : public PpapiUnittest {
- public:
-  PpapiCustomInterfaceFactoryTest() {}
-  virtual ~PpapiCustomInterfaceFactoryTest() {}
-
-  bool result() {
-    return result_;
-  }
-
-  void reset_result() {
-    result_ = false;
-  }
-
-  static const void* InterfaceFactory(const std::string& interface_name) {
-    result_ = true;
-    return NULL;
-  }
-
- private:
-  static bool result_;
-};
-
-bool PpapiCustomInterfaceFactoryTest::result_ = false;
-
-// This test validates whether custom PPAPI interface factories are invoked in
-// response to PluginModule::GetPluginInterface calls.
-TEST_F(PpapiCustomInterfaceFactoryTest, BasicFactoryTest) {
-  PpapiInterfaceFactoryManager::GetInstance()->RegisterFactory(
-      PpapiCustomInterfaceFactoryTest::InterfaceFactory);
-  (*PluginModule::GetLocalGetInterfaceFunc())("DummyInterface");
-  EXPECT_TRUE(result());
-
-  reset_result();
-  PpapiInterfaceFactoryManager::GetInstance()->UnregisterFactory(
-      PpapiCustomInterfaceFactoryTest::InterfaceFactory);
-
-  (*PluginModule::GetLocalGetInterfaceFunc())("DummyInterface");
-  EXPECT_FALSE(result());
-}
-
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/ppapi_unittest.h b/content/renderer/pepper/ppapi_unittest.h
index e7fd8f2..49a0dbf 100644
--- a/content/renderer/pepper/ppapi_unittest.h
+++ b/content/renderer/pepper/ppapi_unittest.h
@@ -15,11 +15,10 @@
 class MessageLoop;
 }
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class MockPluginDelegate;
-class PluginInstanceImpl;
+class PepperPluginInstanceImpl;
 class PluginModule;
 
 class PpapiUnittest : public testing::Test {
@@ -32,7 +31,7 @@
 
   MockPluginDelegate* delegate() { return delegate_.get(); }
   PluginModule* module() const { return module_.get(); }
-  PluginInstanceImpl* instance() const { return instance_.get(); }
+  PepperPluginInstanceImpl* instance() const { return instance_.get(); }
 
   // Provides access to the interfaces implemented by the test. The default one
   // implements PPP_INSTANCE.
@@ -44,22 +43,18 @@
   // Sets the view size of the plugin instance.
   void SetViewSize(int width, int height) const;
 
- protected:
-  virtual MockPluginDelegate* NewPluginDelegate();
-
  private:
   scoped_ptr<MockPluginDelegate> delegate_;
 
   // Note: module must be declared first since we want it to get destroyed last.
   scoped_refptr<PluginModule> module_;
-  scoped_refptr<PluginInstanceImpl> instance_;
+  scoped_refptr<PepperPluginInstanceImpl> instance_;
 
   scoped_ptr<base::MessageLoop> message_loop_;
 
   DISALLOW_COPY_AND_ASSIGN(PpapiUnittest);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPAPI_UNITTEST_H_
diff --git a/content/renderer/pepper/ppb_audio_impl.cc b/content/renderer/pepper/ppb_audio_impl.cc
index 5263826..d971888 100644
--- a/content/renderer/pepper/ppb_audio_impl.cc
+++ b/content/renderer/pepper/ppb_audio_impl.cc
@@ -22,8 +22,7 @@
 using ppapi::thunk::PPB_AudioConfig_API;
 using ppapi::TrackedCallback;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 // PPB_Audio_Impl --------------------------------------------------------------
 
@@ -157,5 +156,4 @@
                 socket_handle, sample_frame_count_);
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/ppb_audio_impl.h b/content/renderer/pepper/ppb_audio_impl.h
index 49146cb..4c30974 100644
--- a/content/renderer/pepper/ppb_audio_impl.h
+++ b/content/renderer/pepper/ppb_audio_impl.h
@@ -19,8 +19,7 @@
 #include "ppapi/shared_impl/resource.h"
 #include "ppapi/shared_impl/scoped_pp_resource.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 // Some of the backend functionality of this class is implemented by the
 // PPB_Audio_Shared so it can be shared with the proxy.
@@ -80,7 +79,6 @@
   DISALLOW_COPY_AND_ASSIGN(PPB_Audio_Impl);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_AUDIO_IMPL_H_
diff --git a/content/renderer/pepper/ppb_broker_impl.cc b/content/renderer/pepper/ppb_broker_impl.cc
index 7401b28..4ba2f88 100644
--- a/content/renderer/pepper/ppb_broker_impl.cc
+++ b/content/renderer/pepper/ppb_broker_impl.cc
@@ -6,8 +6,8 @@
 
 #include "base/logging.h"
 #include "content/renderer/pepper/common.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/plugin_module.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "content/renderer/pepper/resource_helper.h"
 #include "ppapi/shared_impl/platform_file.h"
 #include "third_party/WebKit/public/web/WebDocument.h"
@@ -18,8 +18,7 @@
 using ppapi::thunk::PPB_Broker_API;
 using ppapi::TrackedCallback;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 // PPB_Broker_Impl ------------------------------------------------------
 
@@ -53,7 +52,8 @@
     return PP_ERROR_FAILED;
   }
 
-  PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+  PepperPluginInstanceImpl* plugin_instance =
+      ResourceHelper::GetPluginInstance(this);
   if (!plugin_instance)
     return PP_ERROR_FAILED;
 
@@ -80,7 +80,8 @@
 }
 
 GURL PPB_Broker_Impl::GetDocumentUrl() {
-  PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+  PepperPluginInstanceImpl* plugin_instance =
+      ResourceHelper::GetPluginInstance(this);
   return plugin_instance->container()->element().document().url();
 }
 
@@ -99,5 +100,4 @@
   connect_callback_->Run(result);
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/ppb_broker_impl.h b/content/renderer/pepper/ppb_broker_impl.h
index 0c7a76f..1257d75 100644
--- a/content/renderer/pepper/ppb_broker_impl.h
+++ b/content/renderer/pepper/ppb_broker_impl.h
@@ -15,8 +15,7 @@
 #include "ppapi/shared_impl/tracked_callback.h"
 #include "ppapi/thunk/ppb_broker_api.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class PPB_Broker_Impl : public ::ppapi::Resource,
                         public ::ppapi::thunk::PPB_Broker_API,
@@ -54,7 +53,6 @@
   DISALLOW_COPY_AND_ASSIGN(PPB_Broker_Impl);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_BROKER_IMPL_H_
diff --git a/content/renderer/pepper/ppb_buffer_impl.cc b/content/renderer/pepper/ppb_buffer_impl.cc
index 24599e7..808ebfb 100644
--- a/content/renderer/pepper/ppb_buffer_impl.cc
+++ b/content/renderer/pepper/ppb_buffer_impl.cc
@@ -17,8 +17,7 @@
 
 using ::ppapi::thunk::PPB_Buffer_API;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 PPB_Buffer_Impl::PPB_Buffer_Impl(PP_Instance instance)
     : Resource(::ppapi::OBJECT_IS_IMPL, instance),
@@ -109,5 +108,4 @@
     api_->Unmap();
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/ppb_buffer_impl.h b/content/renderer/pepper/ppb_buffer_impl.h
index 5da2c72..ba042d6 100644
--- a/content/renderer/pepper/ppb_buffer_impl.h
+++ b/content/renderer/pepper/ppb_buffer_impl.h
@@ -12,8 +12,7 @@
 #include "ppapi/shared_impl/resource.h"
 #include "ppapi/thunk/ppb_buffer_api.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class PPB_Buffer_Impl : public ::ppapi::Resource,
                         public ::ppapi::thunk::PPB_Buffer_API {
@@ -74,7 +73,6 @@
   DISALLOW_COPY_AND_ASSIGN(BufferAutoMapper);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_BUFFER_IMPL_H_
diff --git a/content/renderer/pepper/ppb_file_ref_impl.cc b/content/renderer/pepper/ppb_file_ref_impl.cc
index 9a97bed..e0e2edc 100644
--- a/content/renderer/pepper/ppb_file_ref_impl.cc
+++ b/content/renderer/pepper/ppb_file_ref_impl.cc
@@ -9,9 +9,9 @@
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "content/renderer/pepper/common.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/plugin_delegate.h"
 #include "content/renderer/pepper/plugin_module.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "content/renderer/pepper/resource_helper.h"
 #include "net/base/escape.h"
 #include "ppapi/c/pp_errors.h"
@@ -33,8 +33,7 @@
 using ppapi::thunk::PPB_FileRef_API;
 using ppapi::thunk::PPB_FileSystem_API;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 
@@ -232,7 +231,7 @@
 PPB_FileRef_Impl* PPB_FileRef_Impl::CreateInternal(PP_Instance instance,
                                                    PP_Resource pp_file_system,
                                                    const std::string& path) {
-  PluginInstanceImpl* plugin_instance =
+  PepperPluginInstanceImpl* plugin_instance =
       ResourceHelper::PPInstanceToPluginInstance(instance);
   if (!plugin_instance || !plugin_instance->delegate())
     return 0;
@@ -309,7 +308,8 @@
   if (!IsValidNonExternalFileSystem())
     return PP_ERROR_NOACCESS;
 
-  PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+  PepperPluginInstanceImpl* plugin_instance =
+      ResourceHelper::GetPluginInstance(this);
   if (!plugin_instance)
     return PP_ERROR_FAILED;
   plugin_instance->delegate()->MakeDirectory(
@@ -324,7 +324,8 @@
   if (!IsValidNonExternalFileSystem())
     return PP_ERROR_NOACCESS;
 
-  PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+  PepperPluginInstanceImpl* plugin_instance =
+      ResourceHelper::GetPluginInstance(this);
   if (!plugin_instance)
     return PP_ERROR_FAILED;
   plugin_instance->delegate()->Touch(
@@ -339,7 +340,8 @@
   if (!IsValidNonExternalFileSystem())
     return PP_ERROR_NOACCESS;
 
-  PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+  PepperPluginInstanceImpl* plugin_instance =
+      ResourceHelper::GetPluginInstance(this);
   if (!plugin_instance)
     return PP_ERROR_FAILED;
   plugin_instance->delegate()->Delete(
@@ -362,7 +364,8 @@
 
   // TODO(viettrungluu): Also cancel when the new file ref is destroyed?
   // http://crbug.com/67624
-  PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+  PepperPluginInstanceImpl* plugin_instance =
+      ResourceHelper::GetPluginInstance(this);
   if (!plugin_instance)
     return PP_ERROR_FAILED;
   plugin_instance->delegate()->Rename(
@@ -405,7 +408,8 @@
   // We need to trim off the '/' before calling Resolve, as FileSystem URLs
   // start with a storage type identifier that looks like a path segment.
 
-  PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+  PepperPluginInstanceImpl* plugin_instance =
+      ResourceHelper::GetPluginInstance(this);
   PluginDelegate* delegate =
       plugin_instance ? plugin_instance->delegate() : NULL;
   if (!delegate)
@@ -415,7 +419,8 @@
 }
 
 bool PPB_FileRef_Impl::IsValidNonExternalFileSystem() const {
-  PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+  PepperPluginInstanceImpl* plugin_instance =
+      ResourceHelper::GetPluginInstance(this);
   PluginDelegate* delegate =
       plugin_instance ? plugin_instance->delegate() : NULL;
   return delegate &&
@@ -425,7 +430,8 @@
 }
 
 bool PPB_FileRef_Impl::HasValidFileSystem() const {
-  PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+  PepperPluginInstanceImpl* plugin_instance =
+      ResourceHelper::GetPluginInstance(this);
   PluginDelegate* delegate =
       plugin_instance ? plugin_instance->delegate() : NULL;
   return delegate && delegate->IsFileSystemOpened(pp_instance(), file_system_);
@@ -440,7 +446,7 @@
 int32_t PPB_FileRef_Impl::QueryInHost(
     linked_ptr<PP_FileInfo> info,
     scoped_refptr<TrackedCallback> callback) {
-  scoped_refptr<PluginInstanceImpl> plugin_instance =
+  scoped_refptr<PepperPluginInstanceImpl> plugin_instance =
       ResourceHelper::GetPluginInstance(this);
   if (!plugin_instance.get())
     return PP_ERROR_FAILED;
@@ -462,7 +468,7 @@
     if (!HasValidFileSystem())
       return PP_ERROR_NOACCESS;
 
-    PluginInstanceImpl* plugin_instance =
+    PepperPluginInstanceImpl* plugin_instance =
         ResourceHelper::GetPluginInstance(this);
     PluginDelegate* delegate =
         plugin_instance ? plugin_instance->delegate() : NULL;
@@ -493,7 +499,8 @@
   if (!IsValidNonExternalFileSystem())
     return PP_ERROR_NOACCESS;
 
-  PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+  PepperPluginInstanceImpl* plugin_instance =
+      ResourceHelper::GetPluginInstance(this);
   if (!plugin_instance)
     return PP_ERROR_FAILED;
 
@@ -507,5 +514,4 @@
   return PP_OK_COMPLETIONPENDING;
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/ppb_file_ref_impl.h b/content/renderer/pepper/ppb_file_ref_impl.h
index 30612cd..75dda3e 100644
--- a/content/renderer/pepper/ppb_file_ref_impl.h
+++ b/content/renderer/pepper/ppb_file_ref_impl.h
@@ -17,8 +17,7 @@
 #include "ppapi/shared_impl/var.h"
 #include "url/gurl.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 using ::ppapi::StringVar;
 
@@ -120,7 +119,6 @@
   DISALLOW_COPY_AND_ASSIGN(PPB_FileRef_Impl);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_FILE_REF_IMPL_H_
diff --git a/content/renderer/pepper/ppb_flash_message_loop_impl.cc b/content/renderer/pepper/ppb_flash_message_loop_impl.cc
index 105c5a0..c13ecb8 100644
--- a/content/renderer/pepper/ppb_flash_message_loop_impl.cc
+++ b/content/renderer/pepper/ppb_flash_message_loop_impl.cc
@@ -10,8 +10,7 @@
 
 using ppapi::thunk::PPB_Flash_MessageLoop_API;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class PPB_Flash_MessageLoop_Impl::State
     : public base::RefCounted<PPB_Flash_MessageLoop_Impl::State> {
@@ -112,5 +111,4 @@
     state_->run_callback().Run(result);
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/ppb_flash_message_loop_impl.h b/content/renderer/pepper/ppb_flash_message_loop_impl.h
index ef6903c..4bd303d 100644
--- a/content/renderer/pepper/ppb_flash_message_loop_impl.h
+++ b/content/renderer/pepper/ppb_flash_message_loop_impl.h
@@ -11,8 +11,7 @@
 #include "ppapi/shared_impl/resource.h"
 #include "ppapi/thunk/ppb_flash_message_loop_api.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class PPB_Flash_MessageLoop_Impl
     : public ::ppapi::Resource,
@@ -48,7 +47,6 @@
   DISALLOW_COPY_AND_ASSIGN(PPB_Flash_MessageLoop_Impl);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_FLASH_MESSAGE_LOOP_IMPL_H_
diff --git a/content/renderer/pepper/ppb_gpu_blacklist_private_impl.cc b/content/renderer/pepper/ppb_gpu_blacklist_private_impl.cc
index 81c4292..7649cae 100644
--- a/content/renderer/pepper/ppb_gpu_blacklist_private_impl.cc
+++ b/content/renderer/pepper/ppb_gpu_blacklist_private_impl.cc
@@ -11,8 +11,7 @@
 // todo(nfullagar): Remove this private interface when the SRPC proxy is
 // permanently disabled.
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 
@@ -35,6 +34,5 @@
   return &ppb_gpu_blacklist;
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
diff --git a/content/renderer/pepper/ppb_gpu_blacklist_private_impl.h b/content/renderer/pepper/ppb_gpu_blacklist_private_impl.h
index 189afe3..7ff2e90 100644
--- a/content/renderer/pepper/ppb_gpu_blacklist_private_impl.h
+++ b/content/renderer/pepper/ppb_gpu_blacklist_private_impl.h
@@ -7,16 +7,14 @@
 
 #include "ppapi/c/private/ppb_gpu_blacklist_private.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class PPB_GpuBlacklist_Private_Impl {
  public:
   static const PPB_GpuBlacklist_Private* GetInterface();
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_GPU_BLACKLIST_PRIVATE_IMPL_H_
 
diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.cc b/content/renderer/pepper/ppb_graphics_3d_impl.cc
index 26a7789..596febc 100644
--- a/content/renderer/pepper/ppb_graphics_3d_impl.cc
+++ b/content/renderer/pepper/ppb_graphics_3d_impl.cc
@@ -8,8 +8,8 @@
 #include "base/command_line.h"
 #include "base/message_loop/message_loop.h"
 #include "base/strings/utf_string_conversions.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/plugin_module.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "content/renderer/pepper/resource_helper.h"
 #include "gpu/command_buffer/client/gles2_implementation.h"
 #include "ppapi/c/ppp_graphics_3d.h"
@@ -29,8 +29,7 @@
 using WebKit::WebPluginContainer;
 using WebKit::WebString;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 const int32 kCommandBufferSize = 1024 * 1024;
@@ -236,7 +235,8 @@
 
 bool PPB_Graphics3D_Impl::InitRaw(PPB_Graphics3D_API* share_context,
                                   const int32_t* attrib_list) {
-  PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+  PepperPluginInstanceImpl* plugin_instance =
+      ResourceHelper::GetPluginInstance(this);
   if (!plugin_instance)
     return false;
 
@@ -307,7 +307,7 @@
   // By the time we run this, the instance may have been deleted, or in the
   // process of being deleted. Even in the latter case, we don't want to send a
   // callback after DidDestroy.
-  PluginInstanceImpl* instance = ResourceHelper::GetPluginInstance(this);
+  PepperPluginInstanceImpl* instance = ResourceHelper::GetPluginInstance(this);
   if (!instance || !instance->container())
     return;
 
@@ -324,5 +324,4 @@
     ppp_graphics_3d->Graphics3DContextLost(this_pp_instance);
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.h b/content/renderer/pepper/ppb_graphics_3d_impl.h
index e84a766..4d29bdc 100644
--- a/content/renderer/pepper/ppb_graphics_3d_impl.h
+++ b/content/renderer/pepper/ppb_graphics_3d_impl.h
@@ -10,8 +10,7 @@
 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h"
 #include "ppapi/shared_impl/resource.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class PPB_Graphics3D_Impl : public ::ppapi::PPB_Graphics3D_Shared {
  public:
@@ -88,7 +87,6 @@
   DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_
diff --git a/content/renderer/pepper/ppb_image_data_impl.cc b/content/renderer/pepper/ppb_image_data_impl.cc
index e17b348..a7e9895 100644
--- a/content/renderer/pepper/ppb_image_data_impl.cc
+++ b/content/renderer/pepper/ppb_image_data_impl.cc
@@ -20,8 +20,7 @@
 
 using ::ppapi::thunk::PPB_ImageData_API;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 PPB_ImageData_Impl::PPB_ImageData_Impl(PP_Instance instance,
                                        PPB_ImageData_Shared::ImageDataType type)
@@ -274,5 +273,4 @@
   return &skia_bitmap_;
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/ppb_image_data_impl.h b/content/renderer/pepper/ppb_image_data_impl.h
index 58cba82..95aecea 100644
--- a/content/renderer/pepper/ppb_image_data_impl.h
+++ b/content/renderer/pepper/ppb_image_data_impl.h
@@ -18,8 +18,7 @@
 class SkBitmap;
 class SkCanvas;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class CONTENT_EXPORT PPB_ImageData_Impl
     : public ::ppapi::Resource,
@@ -191,7 +190,6 @@
   DISALLOW_COPY_AND_ASSIGN(ImageDataAutoMapper);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_IMAGE_DATA_IMPL_H_
diff --git a/content/renderer/pepper/ppb_network_monitor_private_impl.cc b/content/renderer/pepper/ppb_network_monitor_private_impl.cc
index 75a8935..eb9d99e 100644
--- a/content/renderer/pepper/ppb_network_monitor_private_impl.cc
+++ b/content/renderer/pepper/ppb_network_monitor_private_impl.cc
@@ -11,8 +11,7 @@
 #include "net/base/ip_endpoint.h"
 #include "net/base/net_util.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 PPB_NetworkMonitor_Private_Impl::PPB_NetworkMonitor_Private_Impl(
     PP_Instance instance,
@@ -85,5 +84,4 @@
   callback_(user_data_, list_resource);
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/ppb_network_monitor_private_impl.h b/content/renderer/pepper/ppb_network_monitor_private_impl.h
index c603eb1..3a6b481 100644
--- a/content/renderer/pepper/ppb_network_monitor_private_impl.h
+++ b/content/renderer/pepper/ppb_network_monitor_private_impl.h
@@ -13,8 +13,7 @@
 #include "ppapi/thunk/ppb_network_monitor_private_api.h"
 #include "webkit/glue/network_list_observer.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class PPB_NetworkMonitor_Private_Impl
     : public ::ppapi::Resource,
@@ -47,7 +46,6 @@
   DISALLOW_COPY_AND_ASSIGN(PPB_NetworkMonitor_Private_Impl);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_NETWORK_MONITOR_PRIVATE_IMPL_H_
diff --git a/content/renderer/pepper/ppb_proxy_impl.cc b/content/renderer/pepper/ppb_proxy_impl.cc
index caf63f7..a9d99f3 100644
--- a/content/renderer/pepper/ppb_proxy_impl.cc
+++ b/content/renderer/pepper/ppb_proxy_impl.cc
@@ -14,8 +14,7 @@
 using ppapi::thunk::EnterResource;
 using ppapi::thunk::PPB_URLLoader_API;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 
@@ -75,5 +74,4 @@
   return &ppb_proxy;
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/ppb_proxy_impl.h b/content/renderer/pepper/ppb_proxy_impl.h
index 04e12fc..f7341c0 100644
--- a/content/renderer/pepper/ppb_proxy_impl.h
+++ b/content/renderer/pepper/ppb_proxy_impl.h
@@ -7,16 +7,14 @@
 
 struct PPB_Proxy_Private;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class PPB_Proxy_Impl {
  public:
   static const PPB_Proxy_Private* GetInterface();
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_PROXY_IMPL_H_
 
diff --git a/content/renderer/pepper/ppb_scrollbar_impl.cc b/content/renderer/pepper/ppb_scrollbar_impl.cc
index a326cad..9c6800a 100644
--- a/content/renderer/pepper/ppb_scrollbar_impl.cc
+++ b/content/renderer/pepper/ppb_scrollbar_impl.cc
@@ -9,8 +9,8 @@
 #include "base/message_loop/message_loop.h"
 #include "content/renderer/pepper/common.h"
 #include "content/renderer/pepper/event_conversion.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/plugin_module.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "content/renderer/pepper/ppb_image_data_impl.h"
 #include "content/renderer/pepper/resource_helper.h"
 #include "ppapi/c/dev/ppp_scrollbar_dev.h"
@@ -33,8 +33,7 @@
 using WebKit::WebScrollbar;
 using WebKit::WebPluginScrollbar;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 // static
 PP_Resource PPB_Scrollbar_Impl::Create(PP_Instance instance,
@@ -54,7 +53,8 @@
 }
 
 void PPB_Scrollbar_Impl::Init(bool vertical) {
-  PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+  PepperPluginInstanceImpl* plugin_instance =
+      ResourceHelper::GetPluginInstance(this);
   if (!plugin_instance)
     return;
   scrollbar_.reset(WebPluginScrollbar::createForPlugin(
@@ -247,5 +247,4 @@
   Invalidate(&pp_rect);
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/ppb_scrollbar_impl.h b/content/renderer/pepper/ppb_scrollbar_impl.h
index eed236f..559c303 100644
--- a/content/renderer/pepper/ppb_scrollbar_impl.h
+++ b/content/renderer/pepper/ppb_scrollbar_impl.h
@@ -16,8 +16,7 @@
 #include "third_party/WebKit/public/web/WebPluginScrollbarClient.h"
 #include "ui/gfx/rect.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class PPB_Scrollbar_Impl : public PPB_Widget_Impl,
                            public ::ppapi::thunk::PPB_Scrollbar_API,
@@ -72,7 +71,6 @@
   DISALLOW_COPY_AND_ASSIGN(PPB_Scrollbar_Impl);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_SCROLLBAR_IMPL_H_
diff --git a/content/renderer/pepper/ppb_tcp_server_socket_private_impl.cc b/content/renderer/pepper/ppb_tcp_server_socket_private_impl.cc
index 2e8ceda..5cc66fe 100644
--- a/content/renderer/pepper/ppb_tcp_server_socket_private_impl.cc
+++ b/content/renderer/pepper/ppb_tcp_server_socket_private_impl.cc
@@ -10,8 +10,7 @@
 #include "content/renderer/pepper/ppb_tcp_socket_private_impl.h"
 #include "content/renderer/pepper/resource_helper.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 PPB_TCPServerSocket_Private_Impl::PPB_TCPServerSocket_Private_Impl(
     PP_Instance instance)
@@ -78,5 +77,4 @@
   plugin_delegate->TCPServerSocketStopListening(pp_resource(), socket_id_);
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/ppb_tcp_server_socket_private_impl.h b/content/renderer/pepper/ppb_tcp_server_socket_private_impl.h
index f048c7b..12db9ae 100644
--- a/content/renderer/pepper/ppb_tcp_server_socket_private_impl.h
+++ b/content/renderer/pepper/ppb_tcp_server_socket_private_impl.h
@@ -8,8 +8,7 @@
 #include "base/compiler_specific.h"
 #include "ppapi/shared_impl/private/ppb_tcp_server_socket_shared.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class PPB_TCPServerSocket_Private_Impl
     : public ::ppapi::PPB_TCPServerSocket_Shared {
@@ -34,7 +33,6 @@
   DISALLOW_COPY_AND_ASSIGN(PPB_TCPServerSocket_Private_Impl);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_TCP_SERVER_SOCKET_PRIVATE_IMPL_H_
diff --git a/content/renderer/pepper/ppb_tcp_socket_private_impl.cc b/content/renderer/pepper/ppb_tcp_socket_private_impl.cc
index 7ebcc64..36e560b 100644
--- a/content/renderer/pepper/ppb_tcp_socket_private_impl.cc
+++ b/content/renderer/pepper/ppb_tcp_socket_private_impl.cc
@@ -5,13 +5,12 @@
 #include "content/renderer/pepper/ppb_tcp_socket_private_impl.h"
 
 #include "content/renderer/pepper/host_globals.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/plugin_delegate.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "content/renderer/pepper/resource_helper.h"
 #include "ppapi/shared_impl/socket_option_data.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 PPB_TCPSocket_Private_Impl::PPB_TCPSocket_Private_Impl(
     PP_Instance instance, uint32 socket_id)
@@ -123,12 +122,11 @@
 
 PluginDelegate* PPB_TCPSocket_Private_Impl::GetPluginDelegate(
     PP_Instance instance) {
-  PluginInstanceImpl* plugin_instance =
+  PepperPluginInstanceImpl* plugin_instance =
       HostGlobals::Get()->GetInstance(instance);
   if (!plugin_instance)
     return NULL;
   return plugin_instance->delegate();
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/ppb_tcp_socket_private_impl.h b/content/renderer/pepper/ppb_tcp_socket_private_impl.h
index 7295094..c90e1a7 100644
--- a/content/renderer/pepper/ppb_tcp_socket_private_impl.h
+++ b/content/renderer/pepper/ppb_tcp_socket_private_impl.h
@@ -10,8 +10,7 @@
 #include "base/compiler_specific.h"
 #include "ppapi/shared_impl/private/tcp_socket_private_impl.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class PluginDelegate;
 
@@ -47,7 +46,6 @@
   DISALLOW_COPY_AND_ASSIGN(PPB_TCPSocket_Private_Impl);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_TCP_SOCKET_PRIVATE_IMPL_H_
diff --git a/content/renderer/pepper/ppb_uma_private_impl.cc b/content/renderer/pepper/ppb_uma_private_impl.cc
index 8468dd7..c3c66a5 100644
--- a/content/renderer/pepper/ppb_uma_private_impl.cc
+++ b/content/renderer/pepper/ppb_uma_private_impl.cc
@@ -12,8 +12,7 @@
 
 using ppapi::StringVar;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 
@@ -96,5 +95,4 @@
   return &ppb_uma;
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/ppb_uma_private_impl.h b/content/renderer/pepper/ppb_uma_private_impl.h
index 55a94f4..91eae47 100644
--- a/content/renderer/pepper/ppb_uma_private_impl.h
+++ b/content/renderer/pepper/ppb_uma_private_impl.h
@@ -7,15 +7,13 @@
 
 #include "ppapi/c/private/ppb_uma_private.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class PPB_UMA_Private_Impl {
  public:
   static const PPB_UMA_Private* GetInterface();
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_UMA_PRIVATE_IMPL_H_
diff --git a/content/renderer/pepper/ppb_var_deprecated_impl.cc b/content/renderer/pepper/ppb_var_deprecated_impl.cc
index cbfc6f9..c5353cf 100644
--- a/content/renderer/pepper/ppb_var_deprecated_impl.cc
+++ b/content/renderer/pepper/ppb_var_deprecated_impl.cc
@@ -10,9 +10,9 @@
 #include "content/renderer/pepper/host_globals.h"
 #include "content/renderer/pepper/npapi_glue.h"
 #include "content/renderer/pepper/npobject_var.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/plugin_module.h"
 #include "content/renderer/pepper/plugin_object.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "ppapi/c/dev/ppb_var_deprecated.h"
 #include "ppapi/c/ppb_var.h"
 #include "ppapi/c/pp_var.h"
@@ -26,8 +26,7 @@
 using ppapi::Var;
 using WebKit::WebBindings;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 
@@ -119,7 +118,7 @@
 
   NPObjectVar* object() { return object_.get(); }
 
-  PluginInstanceImpl* GetPluginInstance() {
+  PepperPluginInstanceImpl* GetPluginInstance() {
     return HostGlobals::Get()->GetInstance(object()->pp_instance());
   }
 
@@ -332,7 +331,7 @@
   ObjectAccessorTryCatch accessor(var, exception);
   if (accessor.has_exception())
     return PP_MakeUndefined();
-  PluginInstanceImpl* plugin = accessor.GetPluginInstance();
+  PepperPluginInstanceImpl* plugin = accessor.GetPluginInstance();
   if (plugin && plugin->IsProcessingUserGesture()) {
     WebKit::WebScopedUserGesture user_gesture(
         plugin->CurrentUserGestureToken());
@@ -389,7 +388,8 @@
 PP_Var CreateObjectDeprecated(PP_Instance pp_instance,
                               const PPP_Class_Deprecated* ppp_class,
                               void* ppp_class_data) {
-  PluginInstanceImpl* instance = HostGlobals::Get()->GetInstance(pp_instance);
+  PepperPluginInstanceImpl* instance =
+      HostGlobals::Get()->GetInstance(pp_instance);
   if (!instance) {
     DLOG(ERROR) << "Create object passed an invalid instance.";
     return PP_MakeNull();
@@ -432,6 +432,5 @@
   return &var_deprecated_interface;
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
diff --git a/content/renderer/pepper/ppb_var_deprecated_impl.h b/content/renderer/pepper/ppb_var_deprecated_impl.h
index 459acfa..0531200 100644
--- a/content/renderer/pepper/ppb_var_deprecated_impl.h
+++ b/content/renderer/pepper/ppb_var_deprecated_impl.h
@@ -7,15 +7,13 @@
 
 struct PPB_Var_Deprecated;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class PPB_Var_Deprecated_Impl {
  public:
   static const PPB_Var_Deprecated* GetVarDeprecatedInterface();
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_VAR_DEPRECATED_IMPL_H_
diff --git a/content/renderer/pepper/ppb_video_decoder_impl.cc b/content/renderer/pepper/ppb_video_decoder_impl.cc
index c71f618..c5dc8fc 100644
--- a/content/renderer/pepper/ppb_video_decoder_impl.cc
+++ b/content/renderer/pepper/ppb_video_decoder_impl.cc
@@ -90,8 +90,7 @@
 
 }  // namespace
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 PPB_VideoDecoder_Impl::PPB_VideoDecoder_Impl(PP_Instance instance)
     : PPB_VideoDecoder_Shared(instance),
@@ -299,5 +298,4 @@
   NOTREACHED() << "PlatformVideoDecoder::Initialize() is synchronous!";
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/ppb_video_decoder_impl.h b/content/renderer/pepper/ppb_video_decoder_impl.h
index d2d07b8..b15fa90 100644
--- a/content/renderer/pepper/ppb_video_decoder_impl.h
+++ b/content/renderer/pepper/ppb_video_decoder_impl.h
@@ -25,8 +25,7 @@
 }  // namespace gles2
 }  // namespace gpu
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class PPB_VideoDecoder_Impl : public ::ppapi::PPB_VideoDecoder_Shared,
                               public media::VideoDecodeAccelerator::Client {
@@ -82,7 +81,6 @@
   DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_VIDEO_DECODER_IMPL_H_
diff --git a/content/renderer/pepper/ppb_widget_impl.cc b/content/renderer/pepper/ppb_widget_impl.cc
index 5854f01..39cdf4a 100644
--- a/content/renderer/pepper/ppb_widget_impl.cc
+++ b/content/renderer/pepper/ppb_widget_impl.cc
@@ -4,7 +4,7 @@
 
 #include "content/renderer/pepper/ppb_widget_impl.h"
 
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/ppb_image_data_impl.h"
 #include "content/renderer/pepper/plugin_module.h"
 #include "content/renderer/pepper/resource_helper.h"
@@ -18,8 +18,7 @@
 using ppapi::thunk::PPB_InputEvent_API;
 using ppapi::thunk::PPB_Widget_API;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 PPB_Widget_Impl::PPB_Widget_Impl(PP_Instance instance)
     : Resource(::ppapi::OBJECT_IS_IMPL, instance),
@@ -65,7 +64,8 @@
 }
 
 void PPB_Widget_Impl::Invalidate(const PP_Rect* dirty) {
-  PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+  PepperPluginInstanceImpl* plugin_instance =
+      ResourceHelper::GetPluginInstance(this);
   if (!plugin_instance)
     return;
   const PPP_Widget_Dev* widget = static_cast<const PPP_Widget_Dev*>(
@@ -75,6 +75,5 @@
   widget->Invalidate(pp_instance(), pp_resource(), dirty);
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
diff --git a/content/renderer/pepper/ppb_widget_impl.h b/content/renderer/pepper/ppb_widget_impl.h
index 7b1e950..5a5ef0d 100644
--- a/content/renderer/pepper/ppb_widget_impl.h
+++ b/content/renderer/pepper/ppb_widget_impl.h
@@ -18,8 +18,7 @@
 struct InputEventData;
 }
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class PPB_ImageData_Impl;
 
@@ -59,7 +58,6 @@
   DISALLOW_COPY_AND_ASSIGN(PPB_Widget_Impl);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_WIDGET_IMPL_H_
diff --git a/content/renderer/pepper/ppb_x509_certificate_private_impl.cc b/content/renderer/pepper/ppb_x509_certificate_private_impl.cc
index 0b848d2..6b60a42 100644
--- a/content/renderer/pepper/ppb_x509_certificate_private_impl.cc
+++ b/content/renderer/pepper/ppb_x509_certificate_private_impl.cc
@@ -7,8 +7,7 @@
 #include "content/renderer/pepper/plugin_delegate.h"
 #include "content/renderer/pepper/resource_helper.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 PPB_X509Certificate_Private_Impl::PPB_X509Certificate_Private_Impl(
     PP_Instance instance) :
@@ -34,5 +33,4 @@
 PPB_X509Certificate_Private_Impl::~PPB_X509Certificate_Private_Impl() {
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/ppb_x509_certificate_private_impl.h b/content/renderer/pepper/ppb_x509_certificate_private_impl.h
index 6b8d856..76438c9 100644
--- a/content/renderer/pepper/ppb_x509_certificate_private_impl.h
+++ b/content/renderer/pepper/ppb_x509_certificate_private_impl.h
@@ -14,8 +14,7 @@
 class PPB_X509Certificate_Fields;
 }
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 class PPB_X509Certificate_Private_Impl :
     public ::ppapi::PPB_X509Certificate_Private_Shared {
@@ -31,7 +30,6 @@
   DISALLOW_COPY_AND_ASSIGN(PPB_X509Certificate_Private_Impl);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_X509_CERTIFICATE_PRIVATE_IMPL_H_
diff --git a/content/renderer/pepper/quota_file_io.cc b/content/renderer/pepper/quota_file_io.cc
index 64d26a9..59000a2 100644
--- a/content/renderer/pepper/quota_file_io.cc
+++ b/content/renderer/pepper/quota_file_io.cc
@@ -13,15 +13,13 @@
 #include "base/stl_util.h"
 #include "base/task_runner_util.h"
 #include "content/renderer/pepper/host_globals.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "content/renderer/pepper/resource_helper.h"
 
 using base::PlatformFile;
 using base::PlatformFileError;
 using quota::StorageType;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 StorageType PPFileSystemTypeToQuotaStorageType(PP_FileSystemType type) {
@@ -101,14 +99,8 @@
     }
     DCHECK(buffer_.get());
 
-    PluginDelegate* plugin_delegate = quota_io_->GetPluginDelegate();
-    if (!plugin_delegate) {
-      DidFail(base::PLATFORM_FILE_ERROR_FAILED);
-      return;
-    }
-
     if (!base::PostTaskAndReplyWithResult(
-            plugin_delegate->GetFileThreadMessageLoopProxy().get(),
+            quota_io_->delegate()->GetFileThreadMessageLoopProxy().get(),
             FROM_HERE,
             base::Bind(&WriteAdapter,
                        quota_io_->file_,
@@ -191,14 +183,8 @@
       return;
     }
 
-    PluginDelegate* plugin_delegate = quota_io_->GetPluginDelegate();
-    if (!plugin_delegate) {
-      DidFail(base::PLATFORM_FILE_ERROR_FAILED);
-      return;
-    }
-
     if (!base::FileUtilProxy::Truncate(
-            plugin_delegate->GetFileThreadMessageLoopProxy().get(),
+            quota_io_->delegate()->GetFileThreadMessageLoopProxy().get(),
             quota_io_->file_,
             length_,
             base::Bind(&SetLengthOperation::DidFinish,
@@ -228,11 +214,11 @@
 // QuotaFileIO --------------------------------------------------------------
 
 QuotaFileIO::QuotaFileIO(
-    PP_Instance instance,
+    Delegate* delegate,
     PlatformFile file,
     const GURL& file_url,
     PP_FileSystemType type)
-    : pp_instance_(instance),
+    : delegate_(delegate),
       file_(file),
       file_url_(file_url),
       storage_type_(PPFileSystemTypeToQuotaStorageType(type)),
@@ -287,13 +273,6 @@
   return RegisterOperationForQuotaChecks(op);
 }
 
-PluginDelegate* QuotaFileIO::GetPluginDelegate() const {
-  PluginInstanceImpl* instance = HostGlobals::Get()->GetInstance(pp_instance_);
-  if (instance)
-    return instance->delegate();
-  return NULL;
-}
-
 bool QuotaFileIO::RegisterOperationForQuotaChecks(
     PendingOperationBase* op_ptr) {
   scoped_ptr<PendingOperationBase> op(op_ptr);
@@ -303,14 +282,10 @@
     outstanding_quota_queries_ = 0;
     outstanding_errors_ = 0;
 
-    PluginDelegate* plugin_delegate = GetPluginDelegate();
-    if (!plugin_delegate)
-      return false;
-
     // Query the file size.
     ++outstanding_quota_queries_;
     if (!base::FileUtilProxy::GetFileInfoFromPlatformFile(
-            plugin_delegate->GetFileThreadMessageLoopProxy().get(),
+            delegate_->GetFileThreadMessageLoopProxy().get(),
             file_,
             base::Bind(&QuotaFileIO::DidQueryInfoForQuota,
                        weak_factory_.GetWeakPtr()))) {
@@ -321,7 +296,7 @@
 
     // Query the current available space.
     ++outstanding_quota_queries_;
-    plugin_delegate->QueryAvailableSpace(
+    delegate_->QueryAvailableSpace(
         file_url_.GetOrigin(), storage_type_,
         base::Bind(&QuotaFileIO::DidQueryAvailableSpace,
                    weak_factory_.GetWeakPtr()));
@@ -371,9 +346,7 @@
 
 void QuotaFileIO::WillUpdate() {
   if (inflight_operations_++ == 0) {
-    PluginDelegate* plugin_delegate = GetPluginDelegate();
-    if (plugin_delegate)
-      plugin_delegate->WillUpdateFile(file_url_);
+    delegate_->WillUpdateFile(file_url_);
     DCHECK_EQ(0, max_written_offset_);
   }
 }
@@ -399,9 +372,7 @@
     int64_t growth = max_written_offset_ - cached_file_size_;
     growth = growth < 0 ? 0 : growth;
 
-    PluginDelegate* plugin_delegate = GetPluginDelegate();
-    if (plugin_delegate)
-      plugin_delegate->DidUpdateFile(file_url_, growth);
+    delegate_->DidUpdateFile(file_url_, growth);
     max_written_offset_ = 0;
   }
 }
@@ -413,12 +384,8 @@
   int64_t delta = (error != base::PLATFORM_FILE_OK) ? 0 :
       new_file_size - cached_file_size_;
 
-
-  PluginDelegate* plugin_delegate = GetPluginDelegate();
-  if (plugin_delegate)
-    plugin_delegate->DidUpdateFile(file_url_, delta);
+  delegate_->DidUpdateFile(file_url_, delta);
   inflight_operations_ = 0;
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/quota_file_io.h b/content/renderer/pepper/quota_file_io.h
index 7c95464..8dbcd2a 100644
--- a/content/renderer/pepper/quota_file_io.h
+++ b/content/renderer/pepper/quota_file_io.h
@@ -7,29 +7,49 @@
 
 #include <deque>
 
+#include "base/callback_forward.h"
 #include "base/files/file_util_proxy.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
 #include "base/memory/weak_ptr.h"
 #include "base/platform_file.h"
 #include "content/common/content_export.h"
 #include "ppapi/c/pp_file_info.h"
-#include "ppapi/c/pp_instance.h"
 #include "url/gurl.h"
 #include "webkit/common/quota/quota_types.h"
 
-namespace webkit {
-namespace ppapi {
+namespace base {
+class MessageLoopProxy;
+}
 
-class PluginDelegate;
+namespace content {
 
 // This class is created per PPB_FileIO_Impl instance and provides
 // write operations for quota-managed files (i.e. files of
 // PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY}).
 class QuotaFileIO {
  public:
+  // For quota handlings for FileIO API. This will be owned by QuotaFileIO.
+  class Delegate {
+   public:
+    virtual ~Delegate() {}
+    typedef base::Callback<void (int64)> AvailableSpaceCallback;
+    virtual void QueryAvailableSpace(
+        const GURL& origin,
+        quota::StorageType type,
+        const AvailableSpaceCallback& callback) = 0;
+    virtual void WillUpdateFile(const GURL& file_path) = 0;
+    virtual void DidUpdateFile(const GURL& file_path, int64_t delta) = 0;
+    // Returns a MessageLoopProxy instance associated with the message loop of
+    // the file thread in this renderer.
+    virtual scoped_refptr<base::MessageLoopProxy>
+        GetFileThreadMessageLoopProxy() = 0;
+  };
+
   typedef base::FileUtilProxy::WriteCallback WriteCallback;
   typedef base::FileUtilProxy::StatusCallback StatusCallback;
 
-  CONTENT_EXPORT QuotaFileIO(PP_Instance instance,
+  CONTENT_EXPORT QuotaFileIO(Delegate* delegate,
                              base::PlatformFile file,
                              const GURL& path_url,
                              PP_FileSystemType type);
@@ -58,9 +78,7 @@
   CONTENT_EXPORT bool WillSetLength(int64_t length,
                                     const StatusCallback& callback);
 
-  // Returns the plugin delegate or NULL if the resource has outlived the
-  // instance.
-  PluginDelegate* GetPluginDelegate() const;
+  Delegate* delegate() const { return delegate_.get(); }
 
  private:
   class PendingOperationBase;
@@ -78,8 +96,7 @@
   void DidQueryAvailableSpace(int64_t avail_space);
   void DidQueryForQuotaCheck();
 
-  // The plugin instance that owns this (via PPB_FileIO_Impl).
-  PP_Instance pp_instance_;
+  scoped_ptr<Delegate> delegate_;
 
   // The file information associated to this instance.
   base::PlatformFile file_;
@@ -111,7 +128,6 @@
   DISALLOW_COPY_AND_ASSIGN(QuotaFileIO);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_QUOTA_FILE_IO_H_
diff --git a/content/renderer/pepper/quota_file_io_unittest.cc b/content/renderer/pepper/quota_file_io_unittest.cc
index ad66e52..3d0df1c 100644
--- a/content/renderer/pepper/quota_file_io_unittest.cc
+++ b/content/renderer/pepper/quota_file_io_unittest.cc
@@ -13,8 +13,7 @@
 #include "base/memory/weak_ptr.h"
 #include "base/message_loop/message_loop.h"
 #include "base/platform_file.h"
-#include "content/renderer/pepper/mock_plugin_delegate.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/ppapi_unittest.h"
 #include "content/renderer/pepper/quota_file_io.h"
 
@@ -22,26 +21,20 @@
 using base::PlatformFile;
 using base::PlatformFileError;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
-class QuotaMockPluginDelegate : public MockPluginDelegate {
+class QuotaMockDelegate : public QuotaFileIO::Delegate {
  public:
-  typedef PluginDelegate::AvailableSpaceCallback Callback;
+  typedef QuotaFileIO::Delegate::AvailableSpaceCallback Callback;
 
-  QuotaMockPluginDelegate()
+  QuotaMockDelegate()
       : available_space_(0),
         will_update_count_(0),
         file_thread_(MessageLoopProxy::current()),
         weak_factory_(this) {
   }
-  virtual ~QuotaMockPluginDelegate() {}
-
-  virtual scoped_refptr<MessageLoopProxy>
-      GetFileThreadMessageLoopProxy() OVERRIDE {
-    return file_thread_;
-  }
+  virtual ~QuotaMockDelegate() {}
 
   virtual void QueryAvailableSpace(
       const GURL& origin,
@@ -50,7 +43,7 @@
     DCHECK_EQ(false, callback.is_null());
     MessageLoopProxy::current()->PostTask(
         FROM_HERE, base::Bind(
-            &QuotaMockPluginDelegate::RunAvailableSpaceCallback,
+            &QuotaMockDelegate::RunAvailableSpaceCallback,
             weak_factory_.GetWeakPtr(), callback));
   }
 
@@ -66,6 +59,11 @@
     available_space_ -= delta;
   }
 
+  virtual scoped_refptr<base::MessageLoopProxy>
+        GetFileThreadMessageLoopProxy() OVERRIDE {
+    return file_thread_;
+  }
+
   void set_available_space(int64 available) { available_space_ = available; }
   int64_t available_space() const { return available_space_; }
 
@@ -78,14 +76,15 @@
   int will_update_count_;
   GURL file_path_;
   scoped_refptr<MessageLoopProxy> file_thread_;
-  base::WeakPtrFactory<QuotaMockPluginDelegate> weak_factory_;
+  base::WeakPtrFactory<QuotaMockDelegate> weak_factory_;
 };
 }  // namespace
 
 class QuotaFileIOTest : public PpapiUnittest {
  public:
   QuotaFileIOTest()
-      : weak_factory_(this) {}
+      : delegate_(NULL),
+        weak_factory_(this) {}
 
   virtual void SetUp() OVERRIDE {
     PpapiUnittest::SetUp();
@@ -103,9 +102,9 @@
     ASSERT_EQ(base::PLATFORM_FILE_OK, error);
     ASSERT_NE(base::kInvalidPlatformFileValue, file_);
     ASSERT_FALSE(created);
+    delegate_ = new QuotaMockDelegate;  // Owned by QuotaFileIO.
     quota_file_io_.reset(new QuotaFileIO(
-        instance()->pp_instance(), file_, GURL(),
-        PP_FILESYSTEMTYPE_LOCALTEMPORARY));
+        delegate_, file_, GURL(), PP_FILESYSTEMTYPE_LOCALTEMPORARY));
   }
 
   virtual void TearDown() OVERRIDE {
@@ -116,10 +115,6 @@
   }
 
  protected:
-  virtual MockPluginDelegate* NewPluginDelegate() OVERRIDE {
-    return static_cast<MockPluginDelegate*>(new QuotaMockPluginDelegate);
-  }
-
   void WriteTestBody(bool will_operation) {
     // Attempt to write zero bytes.
     EXPECT_FALSE(quota_file_io_->Write(
@@ -130,7 +125,7 @@
         0, "data", std::numeric_limits<int32_t>::min(),
         base::Bind(&QuotaFileIOTest::DidWrite, weak_factory_.GetWeakPtr())));
 
-    quota_plugin_delegate()->set_available_space(100);
+    delegate()->set_available_space(100);
     std::string read_buffer;
 
     // Write 8 bytes at offset 0 (-> length=8).
@@ -140,7 +135,7 @@
     ASSERT_EQ(1U, num_results());
     EXPECT_EQ(static_cast<int>(data.size()), bytes_written().front());
     EXPECT_EQ(base::PLATFORM_FILE_OK, status().front());
-    EXPECT_EQ(100 - 8, quota_plugin_delegate()->available_space());
+    EXPECT_EQ(100 - 8, delegate()->available_space());
     reset_results();
 
     if (will_operation) {
@@ -161,7 +156,7 @@
     ASSERT_EQ(1U, num_results());
     EXPECT_EQ(static_cast<int>(data.size()), bytes_written().front());
     EXPECT_EQ(base::PLATFORM_FILE_OK, status().front());
-    EXPECT_EQ(100 - 10, quota_plugin_delegate()->available_space());
+    EXPECT_EQ(100 - 10, delegate()->available_space());
     reset_results();
 
     if (will_operation) {
@@ -180,7 +175,7 @@
     ASSERT_EQ(1U, num_results());
     EXPECT_EQ(static_cast<int>(data.size()), bytes_written().front());
     EXPECT_EQ(base::PLATFORM_FILE_OK, status().front());
-    EXPECT_EQ(100 - 15, quota_plugin_delegate()->available_space());
+    EXPECT_EQ(100 - 15, delegate()->available_space());
     reset_results();
 
     if (will_operation) {
@@ -199,7 +194,7 @@
     ASSERT_EQ(1U, num_results());
     EXPECT_EQ(static_cast<int>(data.size()), bytes_written().front());
     EXPECT_EQ(base::PLATFORM_FILE_OK, status().front());
-    EXPECT_EQ(100 - 15, quota_plugin_delegate()->available_space());
+    EXPECT_EQ(100 - 15, delegate()->available_space());
     reset_results();
 
     if (will_operation) {
@@ -217,7 +212,7 @@
     ASSERT_EQ(1U, num_results());
     EXPECT_EQ(static_cast<int>(data.size()), bytes_written().front());
     EXPECT_EQ(base::PLATFORM_FILE_OK, status().front());
-    EXPECT_EQ(100 - 24, quota_plugin_delegate()->available_space());
+    EXPECT_EQ(100 - 24, delegate()->available_space());
     reset_results();
 
     if (will_operation) {
@@ -229,7 +224,7 @@
       EXPECT_EQ(std::string("123355559012345\0\0\0\0\0XXXX", 24), read_buffer);
     }
 
-    quota_plugin_delegate()->set_available_space(5);
+    delegate()->set_available_space(5);
 
     // Quota error case.  Write 7 bytes at offset 23 (-> length is unchanged)
     data = "ABCDEFG";
@@ -237,7 +232,7 @@
     base::MessageLoop::current()->RunUntilIdle();
     ASSERT_EQ(1U, num_results());
     EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status().front());
-    EXPECT_EQ(5, quota_plugin_delegate()->available_space());
+    EXPECT_EQ(5, delegate()->available_space());
     reset_results();
 
     // Overlapping write.  Write 6 bytes at offset 2 (-> length is unchanged)
@@ -247,7 +242,7 @@
     ASSERT_EQ(1U, num_results());
     EXPECT_EQ(static_cast<int>(data.size()), bytes_written().front());
     EXPECT_EQ(base::PLATFORM_FILE_OK, status().front());
-    EXPECT_EQ(5, quota_plugin_delegate()->available_space());
+    EXPECT_EQ(5, delegate()->available_space());
     reset_results();
 
     // Overlapping + extending the file size, but within the quota.
@@ -257,7 +252,7 @@
     ASSERT_EQ(1U, num_results());
     EXPECT_EQ(static_cast<int>(data.size()), bytes_written().front());
     EXPECT_EQ(base::PLATFORM_FILE_OK, status().front());
-    EXPECT_EQ(0, quota_plugin_delegate()->available_space());
+    EXPECT_EQ(0, delegate()->available_space());
     reset_results();
 
     if (!will_operation) {
@@ -269,21 +264,21 @@
   }
 
   void SetLengthTestBody(bool will_operation) {
-    quota_plugin_delegate()->set_available_space(100);
+    delegate()->set_available_space(100);
 
     SetLength(0, will_operation);
     base::MessageLoop::current()->RunUntilIdle();
     ASSERT_EQ(1U, num_results());
     EXPECT_EQ(base::PLATFORM_FILE_OK, status().front());
     EXPECT_EQ(0, GetPlatformFileSize());
-    EXPECT_EQ(100, quota_plugin_delegate()->available_space());
+    EXPECT_EQ(100, delegate()->available_space());
     reset_results();
 
     SetLength(8, will_operation);
     base::MessageLoop::current()->RunUntilIdle();
     ASSERT_EQ(1U, num_results());
     EXPECT_EQ(base::PLATFORM_FILE_OK, status().front());
-    EXPECT_EQ(100 - 8, quota_plugin_delegate()->available_space());
+    EXPECT_EQ(100 - 8, delegate()->available_space());
     reset_results();
 
     if (will_operation) {
@@ -297,7 +292,7 @@
     base::MessageLoop::current()->RunUntilIdle();
     ASSERT_EQ(1U, num_results());
     EXPECT_EQ(base::PLATFORM_FILE_OK, status().front());
-    EXPECT_EQ(100 - 16, quota_plugin_delegate()->available_space());
+    EXPECT_EQ(100 - 16, delegate()->available_space());
     reset_results();
 
     if (will_operation) {
@@ -311,7 +306,7 @@
     base::MessageLoop::current()->RunUntilIdle();
     ASSERT_EQ(1U, num_results());
     EXPECT_EQ(base::PLATFORM_FILE_OK, status().front());
-    EXPECT_EQ(100 - 4, quota_plugin_delegate()->available_space());
+    EXPECT_EQ(100 - 4, delegate()->available_space());
     reset_results();
 
     if (will_operation) {
@@ -325,7 +320,7 @@
     base::MessageLoop::current()->RunUntilIdle();
     ASSERT_EQ(1U, num_results());
     EXPECT_EQ(base::PLATFORM_FILE_OK, status().front());
-    EXPECT_EQ(100, quota_plugin_delegate()->available_space());
+    EXPECT_EQ(100, delegate()->available_space());
     reset_results();
 
     if (will_operation) {
@@ -335,19 +330,19 @@
       EXPECT_EQ(0, GetPlatformFileSize());
     }
 
-    quota_plugin_delegate()->set_available_space(5);
+    delegate()->set_available_space(5);
 
     // Quota error case.
     SetLength(7, will_operation);
     base::MessageLoop::current()->RunUntilIdle();
     ASSERT_EQ(1U, num_results());
     EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status().front());
-    EXPECT_EQ(5, quota_plugin_delegate()->available_space());
+    EXPECT_EQ(5, delegate()->available_space());
     reset_results();
   }
 
-  QuotaMockPluginDelegate* quota_plugin_delegate() {
-    return static_cast<QuotaMockPluginDelegate*>(delegate());
+  QuotaMockDelegate* delegate() {
+    return delegate_;
   }
 
   void Write(int64_t offset, const std::string& data, bool will_operation) {
@@ -429,6 +424,7 @@
   scoped_ptr<QuotaFileIO> quota_file_io_;
   std::deque<int> bytes_written_;
   std::deque<PlatformFileError> status_;
+  QuotaMockDelegate* delegate_;
   base::WeakPtrFactory<QuotaFileIOTest> weak_factory_;
 };
 
@@ -449,7 +445,7 @@
 }
 
 TEST_F(QuotaFileIOTest, ParallelWrites) {
-  quota_plugin_delegate()->set_available_space(22);
+  delegate()->set_available_space(22);
   std::string read_buffer;
 
   const std::string data1[] = {
@@ -469,7 +465,7 @@
     pop_result();
   }
 
-  EXPECT_EQ(22 - 15, quota_plugin_delegate()->available_space());
+  EXPECT_EQ(22 - 15, delegate()->available_space());
   EXPECT_EQ(15, GetPlatformFileSize());
   ReadPlatformFile(&read_buffer);
   EXPECT_EQ("123455559012345", read_buffer);
@@ -491,11 +487,10 @@
   EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status().front());
   pop_result();
 
-  EXPECT_EQ(22 - 15, quota_plugin_delegate()->available_space());
+  EXPECT_EQ(22 - 15, delegate()->available_space());
   EXPECT_EQ(15, GetPlatformFileSize());
   ReadPlatformFile(&read_buffer);
   EXPECT_EQ("123355559012345", read_buffer);
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/renderer_ppapi_host_impl.cc b/content/renderer/pepper/renderer_ppapi_host_impl.cc
index 0d6768f..3d371bb 100644
--- a/content/renderer/pepper/renderer_ppapi_host_impl.cc
+++ b/content/renderer/pepper/renderer_ppapi_host_impl.cc
@@ -15,9 +15,9 @@
 #include "content/renderer/pepper/pepper_in_process_resource_creation.h"
 #include "content/renderer/pepper/pepper_in_process_router.h"
 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/plugin_delegate.h"
 #include "content/renderer/pepper/plugin_module.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "content/renderer/render_view_impl.h"
 #include "content/renderer/render_widget_fullscreen_pepper.h"
 #include "ipc/ipc_message.h"
@@ -29,11 +29,6 @@
 #include "third_party/WebKit/public/web/WebPluginContainer.h"
 #include "ui/gfx/point.h"
 
-using webkit::ppapi::HostGlobals;
-using webkit::ppapi::PluginInstance;
-using webkit::ppapi::PluginInstanceImpl;
-using webkit::ppapi::PluginModule;
-
 namespace content {
 // static
 CONTENT_EXPORT RendererPpapiHost*
@@ -113,7 +108,8 @@
 // static
 RendererPpapiHostImpl* RendererPpapiHostImpl::GetForPPInstance(
     PP_Instance pp_instance) {
-  PluginInstanceImpl* instance = HostGlobals::Get()->GetInstance(pp_instance);
+  PepperPluginInstanceImpl* instance =
+      HostGlobals::Get()->GetInstance(pp_instance);
   if (!instance)
     return NULL;
 
@@ -125,14 +121,14 @@
 
 scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>
 RendererPpapiHostImpl::CreateInProcessResourceCreationAPI(
-    PluginInstanceImpl* instance) {
+    PepperPluginInstanceImpl* instance) {
   return scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>(
       new PepperInProcessResourceCreation(this, instance));
 }
 
 PepperBrowserConnection*
 RendererPpapiHostImpl::GetBrowserConnection(PP_Instance instance) const {
-  PluginInstanceImpl* instance_object = GetAndValidateInstance(instance);
+  PepperPluginInstanceImpl* instance_object = GetAndValidateInstance(instance);
   if (!instance_object)
     return NULL;
 
@@ -146,7 +142,7 @@
   return delegate->pepper_browser_connection();
 }
 
-webkit::ppapi::PluginInstanceImpl* RendererPpapiHostImpl::GetPluginInstanceImpl(
+PepperPluginInstanceImpl* RendererPpapiHostImpl::GetPluginInstanceImpl(
     PP_Instance instance) const {
   return GetAndValidateInstance(instance);
 }
@@ -157,7 +153,7 @@
 
 RenderView* RendererPpapiHostImpl::GetRenderViewForInstance(
     PP_Instance instance) const {
-  PluginInstanceImpl* instance_object = GetAndValidateInstance(instance);
+  PepperPluginInstanceImpl* instance_object = GetAndValidateInstance(instance);
   if (!instance_object)
     return NULL;
 
@@ -171,14 +167,14 @@
   return !!GetAndValidateInstance(instance);
 }
 
-webkit::ppapi::PluginInstance* RendererPpapiHostImpl::GetPluginInstance(
+PepperPluginInstance* RendererPpapiHostImpl::GetPluginInstance(
     PP_Instance instance) const {
   return GetAndValidateInstance(instance);
 }
 
 WebKit::WebPluginContainer* RendererPpapiHostImpl::GetContainerForInstance(
       PP_Instance instance) const {
-  PluginInstanceImpl* instance_object = GetAndValidateInstance(instance);
+  PepperPluginInstanceImpl* instance_object = GetAndValidateInstance(instance);
   if (!instance_object)
     return NULL;
   return instance_object->container();
@@ -191,7 +187,7 @@
 }
 
 bool RendererPpapiHostImpl::HasUserGesture(PP_Instance instance) const {
-  PluginInstanceImpl* instance_object = GetAndValidateInstance(instance);
+  PepperPluginInstanceImpl* instance_object = GetAndValidateInstance(instance);
   if (!instance_object)
     return false;
 
@@ -202,13 +198,11 @@
 }
 
 int RendererPpapiHostImpl::GetRoutingIDForWidget(PP_Instance instance) const {
-  webkit::ppapi::PluginInstanceImpl* plugin_instance =
-      GetAndValidateInstance(instance);
+  PepperPluginInstanceImpl* plugin_instance = GetAndValidateInstance(instance);
   if (!plugin_instance)
     return 0;
   if (plugin_instance->flash_fullscreen()) {
-    webkit::ppapi::FullscreenContainer* container =
-        plugin_instance->fullscreen_container();
+    FullscreenContainer* container = plugin_instance->fullscreen_container();
     return static_cast<RenderWidgetFullscreenPepper*>(container)->routing_id();
   }
   return GetRenderViewForInstance(instance)->GetRoutingID();
@@ -217,8 +211,7 @@
 gfx::Point RendererPpapiHostImpl::PluginPointToRenderView(
     PP_Instance instance,
     const gfx::Point& pt) const {
-  webkit::ppapi::PluginInstanceImpl* plugin_instance =
-      GetAndValidateInstance(instance);
+  PepperPluginInstanceImpl* plugin_instance = GetAndValidateInstance(instance);
   if (!plugin_instance)
     return pt;
 
@@ -269,9 +262,10 @@
   }
 }
 
-PluginInstanceImpl* RendererPpapiHostImpl::GetAndValidateInstance(
+PepperPluginInstanceImpl* RendererPpapiHostImpl::GetAndValidateInstance(
     PP_Instance pp_instance) const {
-  PluginInstanceImpl* instance = HostGlobals::Get()->GetInstance(pp_instance);
+  PepperPluginInstanceImpl* instance =
+      HostGlobals::Get()->GetInstance(pp_instance);
   if (!instance)
     return NULL;
   if (!instance->IsValidInstanceOf(module_))
diff --git a/content/renderer/pepper/renderer_ppapi_host_impl.h b/content/renderer/pepper/renderer_ppapi_host_impl.h
index 6d576f7..c62009a 100644
--- a/content/renderer/pepper/renderer_ppapi_host_impl.h
+++ b/content/renderer/pepper/renderer_ppapi_host_impl.h
@@ -29,23 +29,17 @@
 
 }  // namespace ppapi
 
-namespace webkit {
-namespace ppapi {
-class PluginInstanceImpl;
-class PluginModule;
-}
-}
-
 namespace content {
 
 class PepperBrowserConnection;
 class PepperInProcessRouter;
+class PepperPluginInstanceImpl;
+class PluginModule;
 
 // This class is attached to a PluginModule via the module's embedder state.
 // The plugin module manages our lifetime.
-class RendererPpapiHostImpl
-    : public RendererPpapiHost,
-      public webkit::ppapi::PluginModule::EmbedderState {
+class RendererPpapiHostImpl : public RendererPpapiHost,
+                              public PluginModule::EmbedderState {
  public:
   virtual ~RendererPpapiHostImpl();
 
@@ -56,11 +50,11 @@
   // The module will take ownership of the new host impl. The returned value
   // does not pass ownership, it's just for the information of the caller.
   static RendererPpapiHostImpl* CreateOnModuleForOutOfProcess(
-      webkit::ppapi::PluginModule* module,
+      PluginModule* module,
       ppapi::proxy::HostDispatcher* dispatcher,
       const ppapi::PpapiPermissions& permissions);
   static RendererPpapiHostImpl* CreateOnModuleForInProcess(
-      webkit::ppapi::PluginModule* module,
+      PluginModule* module,
       const ppapi::PpapiPermissions& permissions);
 
   // Returns the RendererPpapiHostImpl associated with the given PP_Instance,
@@ -80,18 +74,16 @@
   // creation object is associated with the instance, this will generally
   // happen automatically.
   scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>
-      CreateInProcessResourceCreationAPI(
-          webkit::ppapi::PluginInstanceImpl* instance);
+      CreateInProcessResourceCreationAPI(PepperPluginInstanceImpl* instance);
 
   PepperBrowserConnection* GetBrowserConnection(PP_Instance instance) const;
 
-  webkit::ppapi::PluginInstanceImpl* GetPluginInstanceImpl(
-      PP_Instance instance) const;
+  PepperPluginInstanceImpl* GetPluginInstanceImpl(PP_Instance instance) const;
 
   // RendererPpapiHost implementation.
   virtual ppapi::host::PpapiHost* GetPpapiHost() OVERRIDE;
   virtual bool IsValidInstance(PP_Instance instance) const OVERRIDE;
-  virtual webkit::ppapi::PluginInstance* GetPluginInstance(
+  virtual PepperPluginInstance* GetPluginInstance(
       PP_Instance instance) const OVERRIDE;
   virtual RenderView* GetRenderViewForInstance(
       PP_Instance instance) const OVERRIDE;
@@ -113,10 +105,10 @@
       const base::Callback<void(int)>& callback) const OVERRIDE;
 
  private:
-  RendererPpapiHostImpl(webkit::ppapi::PluginModule* module,
+  RendererPpapiHostImpl(PluginModule* module,
                         ppapi::proxy::HostDispatcher* dispatcher,
                         const ppapi::PpapiPermissions& permissions);
-  RendererPpapiHostImpl(webkit::ppapi::PluginModule* module,
+  RendererPpapiHostImpl(PluginModule* module,
                         const ppapi::PpapiPermissions& permissions);
 
   // Retrieves the plugin instance object associated with the given PP_Instance
@@ -125,10 +117,9 @@
   //
   // We use this to security check the PP_Instance values sent from a plugin to
   // make sure it's not trying to spoof another instance.
-  webkit::ppapi::PluginInstanceImpl* GetAndValidateInstance(
-      PP_Instance instance) const;
+  PepperPluginInstanceImpl* GetAndValidateInstance(PP_Instance instance) const;
 
-  webkit::ppapi::PluginModule* module_;  // Non-owning pointer.
+  PluginModule* module_;  // Non-owning pointer.
 
   // The dispatcher we use to send messagse when the plugin is out-of-process.
   // Will be null when running in-process. Non-owning pointer.
diff --git a/content/renderer/pepper/resource_creation_impl.cc b/content/renderer/pepper/resource_creation_impl.cc
index 63fbe35..cb8aa48 100644
--- a/content/renderer/pepper/resource_creation_impl.cc
+++ b/content/renderer/pepper/resource_creation_impl.cc
@@ -31,10 +31,9 @@
 using ppapi::PPB_ResourceArray_Shared;
 using ppapi::StringVar;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
-ResourceCreationImpl::ResourceCreationImpl(PluginInstanceImpl* instance) {
+ResourceCreationImpl::ResourceCreationImpl(PepperPluginInstanceImpl* instance) {
 }
 
 ResourceCreationImpl::~ResourceCreationImpl() {
@@ -313,5 +312,4 @@
   return PPB_X509Certificate_Private_Impl::CreateResource(instance);
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/resource_creation_impl.h b/content/renderer/pepper/resource_creation_impl.h
index 8ed7ac4..7d09822 100644
--- a/content/renderer/pepper/resource_creation_impl.h
+++ b/content/renderer/pepper/resource_creation_impl.h
@@ -9,10 +9,9 @@
 #include "base/compiler_specific.h"
 #include "ppapi/thunk/resource_creation_api.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
-class PluginInstanceImpl;
+class PepperPluginInstanceImpl;
 
 // This is an abstract class.  ResourceCreationAPI functions that implement
 // "old-style" resources are handled here. See
@@ -20,7 +19,7 @@
 // that implement "new-style" resources.
 class ResourceCreationImpl : public ::ppapi::thunk::ResourceCreationAPI {
  public:
-  explicit ResourceCreationImpl(PluginInstanceImpl* instance);
+  explicit ResourceCreationImpl(PepperPluginInstanceImpl* instance);
   virtual ~ResourceCreationImpl();
 
   // ResourceCreationAPI implementation.
@@ -145,7 +144,6 @@
   DISALLOW_COPY_AND_ASSIGN(ResourceCreationImpl);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_RESOURCE_CREATION_IMPL_H_
diff --git a/content/renderer/pepper/resource_helper.cc b/content/renderer/pepper/resource_helper.cc
index c665223..0f4ebda 100644
--- a/content/renderer/pepper/resource_helper.cc
+++ b/content/renderer/pepper/resource_helper.cc
@@ -6,36 +6,34 @@
 
 #include "base/logging.h"
 #include "content/renderer/pepper/host_globals.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/plugin_module.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "ppapi/shared_impl/resource.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 // static
-PluginInstanceImpl* ResourceHelper::GetPluginInstance(
+PepperPluginInstanceImpl* ResourceHelper::GetPluginInstance(
     const ::ppapi::Resource* resource) {
   return PPInstanceToPluginInstance(resource->pp_instance());
 }
 
-PluginInstanceImpl* ResourceHelper::PPInstanceToPluginInstance(
+PepperPluginInstanceImpl* ResourceHelper::PPInstanceToPluginInstance(
     PP_Instance instance) {
   return HostGlobals::Get()->GetInstance(instance);
 }
 
 PluginModule* ResourceHelper::GetPluginModule(
     const ::ppapi::Resource* resource) {
-  PluginInstanceImpl* instance = GetPluginInstance(resource);
+  PepperPluginInstanceImpl* instance = GetPluginInstance(resource);
   return instance ? instance->module() : NULL;
 }
 
 PluginDelegate* ResourceHelper::GetPluginDelegate(
     const ::ppapi::Resource* resource) {
-  PluginInstanceImpl* instance = GetPluginInstance(resource);
+  PepperPluginInstanceImpl* instance = GetPluginInstance(resource);
   return instance ? instance->delegate() : NULL;
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
diff --git a/content/renderer/pepper/resource_helper.h b/content/renderer/pepper/resource_helper.h
index fa8483f..2f855f6 100644
--- a/content/renderer/pepper/resource_helper.h
+++ b/content/renderer/pepper/resource_helper.h
@@ -13,10 +13,9 @@
 class Resource;
 }
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
-class PluginInstanceImpl;
+class PepperPluginInstanceImpl;
 class PluginModule;
 class PluginDelegate;
 
@@ -29,7 +28,7 @@
  public:
   // Returns the instance implementation object for the given resource, or NULL
   // if the resource has outlived its instance.
-  static PluginInstanceImpl* GetPluginInstance(
+  static PepperPluginInstanceImpl* GetPluginInstance(
       const ::ppapi::Resource* resource);
 
   // Returns the module for the given resource, or NULL if the resource has
@@ -41,13 +40,13 @@
   static PluginDelegate* GetPluginDelegate(const ::ppapi::Resource* resource);
 
   // Returns the instance implementation object for the pp_instance.
-  static PluginInstanceImpl* PPInstanceToPluginInstance(PP_Instance instance);
+  static PepperPluginInstanceImpl* PPInstanceToPluginInstance(
+      PP_Instance instance);
 
  private:
   DISALLOW_IMPLICIT_CONSTRUCTORS(ResourceHelper);
 };
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_RESOURCE_IMPL_HELPER_H_
diff --git a/content/renderer/pepper/url_request_info_util.cc b/content/renderer/pepper/url_request_info_util.cc
index 08fc076..d3c4506 100644
--- a/content/renderer/pepper/url_request_info_util.cc
+++ b/content/renderer/pepper/url_request_info_util.cc
@@ -35,8 +35,7 @@
 using WebKit::WebURL;
 using WebKit::WebURLRequest;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 
@@ -201,5 +200,4 @@
       url_util::FindAndCompareScheme(data.url, "javascript", NULL);
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/url_request_info_util.h b/content/renderer/pepper/url_request_info_util.h
index 88cabc8..4261535 100644
--- a/content/renderer/pepper/url_request_info_util.h
+++ b/content/renderer/pepper/url_request_info_util.h
@@ -17,8 +17,7 @@
 class WebURLRequest;
 }
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 // Creates the WebKit URL request from the current request info. Returns true
 // on success, false if the request is invalid (in which case *dest may be
@@ -32,7 +31,6 @@
 CONTENT_EXPORT bool URLRequestRequiresUniversalAccess(
     const ::ppapi::URLRequestInfoData& data);
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_PPB_URL_REQUEST_INFO_UTIL_H_
diff --git a/content/renderer/pepper/url_response_info_util.cc b/content/renderer/pepper/url_response_info_util.cc
index f07a9b9..883f772 100644
--- a/content/renderer/pepper/url_response_info_util.cc
+++ b/content/renderer/pepper/url_response_info_util.cc
@@ -13,7 +13,6 @@
 #include "third_party/WebKit/public/platform/WebURL.h"
 #include "third_party/WebKit/public/platform/WebURLResponse.h"
 
-using webkit::ppapi::PPB_FileRef_Impl;
 using WebKit::WebHTTPHeaderVisitor;
 using WebKit::WebString;
 using WebKit::WebURLResponse;
diff --git a/content/renderer/pepper/usb_key_code_conversion.cc b/content/renderer/pepper/usb_key_code_conversion.cc
index 2640417..5ad8226 100644
--- a/content/renderer/pepper/usb_key_code_conversion.cc
+++ b/content/renderer/pepper/usb_key_code_conversion.cc
@@ -8,8 +8,7 @@
 
 using WebKit::WebKeyboardEvent;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 #if !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_WIN)
 
@@ -19,5 +18,4 @@
 
 #endif
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/usb_key_code_conversion.h b/content/renderer/pepper/usb_key_code_conversion.h
index 459e662..22583cc 100644
--- a/content/renderer/pepper/usb_key_code_conversion.h
+++ b/content/renderer/pepper/usb_key_code_conversion.h
@@ -11,8 +11,7 @@
 class WebKeyboardEvent;
 }  // namespace WebKit
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 // Returns a 32-bit "USB Key Code" for the key identifier by the supplied
 // WebKeyboardEvent. The supplied event must be a KeyDown or KeyUp.
@@ -21,7 +20,6 @@
 // is returned.
 uint32_t UsbKeyCodeForKeyboardEvent(const WebKit::WebKeyboardEvent& key_event);
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_USB_KEY_CODE_CONVERSION_H_
diff --git a/content/renderer/pepper/usb_key_code_conversion_linux.cc b/content/renderer/pepper/usb_key_code_conversion_linux.cc
index fd5e2b1..4c41b91 100644
--- a/content/renderer/pepper/usb_key_code_conversion_linux.cc
+++ b/content/renderer/pepper/usb_key_code_conversion_linux.cc
@@ -9,8 +9,7 @@
 
 using WebKit::WebKeyboardEvent;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 
@@ -28,5 +27,4 @@
   return NativeKeycodeToUsbKeycode(key_event.nativeKeyCode);
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/usb_key_code_conversion_mac.cc b/content/renderer/pepper/usb_key_code_conversion_mac.cc
index 4f55366..2a7e3d7 100644
--- a/content/renderer/pepper/usb_key_code_conversion_mac.cc
+++ b/content/renderer/pepper/usb_key_code_conversion_mac.cc
@@ -9,8 +9,7 @@
 
 using WebKit::WebKeyboardEvent;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 
@@ -24,5 +23,4 @@
   return NativeKeycodeToUsbKeycode(key_event.nativeKeyCode);
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/usb_key_code_conversion_win.cc b/content/renderer/pepper/usb_key_code_conversion_win.cc
index 5ef1d81..126f3d6 100644
--- a/content/renderer/pepper/usb_key_code_conversion_win.cc
+++ b/content/renderer/pepper/usb_key_code_conversion_win.cc
@@ -9,8 +9,7 @@
 
 using WebKit::WebKeyboardEvent;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 
@@ -29,5 +28,4 @@
   return NativeKeycodeToUsbKeycode(scancode);
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/v8_var_converter.cc b/content/renderer/pepper/v8_var_converter.cc
index 202a7cc..25f9b66 100644
--- a/content/renderer/pepper/v8_var_converter.cc
+++ b/content/renderer/pepper/v8_var_converter.cc
@@ -60,8 +60,7 @@
 #endif
 }  // namespace BASE_HASH_NAMESPACE
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 namespace V8VarConverter {
 
 namespace {
@@ -466,5 +465,4 @@
 }
 
 }  // namespace V8VarConverter
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/pepper/v8_var_converter.h b/content/renderer/pepper/v8_var_converter.h
index 2a07bfb..87a6b36 100644
--- a/content/renderer/pepper/v8_var_converter.h
+++ b/content/renderer/pepper/v8_var_converter.h
@@ -12,8 +12,7 @@
 #include "v8/include/v8.h"
 #include "content/common/content_export.h"
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 namespace V8VarConverter {
 
 // Converts the given PP_Var to a v8::Value. True is returned upon success.
@@ -29,7 +28,6 @@
                                 PP_Var* result);
 
 }  // namespace V8VarConverter
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
 
 #endif  // CONTENT_RENDERER_PEPPER_V8_VAR_CONVERTER_H
diff --git a/content/renderer/pepper/v8_var_converter_unittest.cc b/content/renderer/pepper/v8_var_converter_unittest.cc
index 794c665..3c3365d 100644
--- a/content/renderer/pepper/v8_var_converter_unittest.cc
+++ b/content/renderer/pepper/v8_var_converter_unittest.cc
@@ -35,8 +35,7 @@
 using ppapi::TestEqual;
 using ppapi::VarTracker;
 
-namespace webkit {
-namespace ppapi {
+namespace content {
 
 namespace {
 
@@ -383,5 +382,4 @@
   }
 }
 
-}  // namespace ppapi
-}  // namespace webkit
+}  // namespace content
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc
index 5e8e0c6..fedb2a2 100644
--- a/content/renderer/render_view_browsertest.cc
+++ b/content/renderer/render_view_browsertest.cc
@@ -12,6 +12,8 @@
 #include "content/public/browser/native_web_keyboard_event.h"
 #include "content/public/browser/web_ui_controller_factory.h"
 #include "content/public/common/bindings_policy.h"
+#include "content/public/common/page_zoom.h"
+#include "content/public/common/url_constants.h"
 #include "content/public/common/url_utils.h"
 #include "content/public/renderer/document_state.h"
 #include "content/public/renderer/history_item_serialization.h"
@@ -1830,10 +1832,8 @@
 #endif
 
 TEST_F(RenderViewImplTest, ZoomLimit) {
-  const double kMinZoomLevel =
-      WebKit::WebView::zoomFactorToZoomLevel(kMinimumZoomFactor);
-  const double kMaxZoomLevel =
-      WebKit::WebView::zoomFactorToZoomLevel(kMaximumZoomFactor);
+  const double kMinZoomLevel = ZoomFactorToZoomLevel(kMinimumZoomFactor);
+  const double kMaxZoomLevel = ZoomFactorToZoomLevel(kMaximumZoomFactor);
 
   ViewMsg_Navigate_Params params;
   params.page_id = -1;
@@ -1849,9 +1849,8 @@
   EXPECT_DOUBLE_EQ(kMinZoomLevel, view()->GetWebView()->zoomLevel());
 
   // It should work even when the zoom limit is temporarily changed in the page.
-  view()->GetWebView()->zoomLimitsChanged(
-      WebKit::WebView::zoomFactorToZoomLevel(1.0),
-      WebKit::WebView::zoomFactorToZoomLevel(1.0));
+  view()->GetWebView()->zoomLimitsChanged(ZoomFactorToZoomLevel(1.0),
+                                          ZoomFactorToZoomLevel(1.0));
   params.url = GURL("data:text/html,max_zoomlimit_test");
   view()->OnSetZoomLevelForLoadingURL(params.url, kMaxZoomLevel);
   view()->OnNavigate(params);
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index f924813..debf4ec 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -55,6 +55,7 @@
 #include "content/public/common/drop_data.h"
 #include "content/public/common/favicon_url.h"
 #include "content/public/common/file_chooser_params.h"
+#include "content/public/common/page_zoom.h"
 #include "content/public/common/ssl_status.h"
 #include "content/public/common/three_d_api_types.h"
 #include "content/public/common/url_constants.h"
@@ -97,6 +98,7 @@
 #include "content/renderer/media/media_stream_dependency_factory.h"
 #include "content/renderer/media/media_stream_dispatcher.h"
 #include "content/renderer/media/media_stream_impl.h"
+#include "content/renderer/media/midi_dispatcher.h"
 #include "content/renderer/media/render_media_log.h"
 #include "content/renderer/media/rtc_peer_connection_handler.h"
 #include "content/renderer/media/video_capture_impl_manager.h"
@@ -1862,9 +1864,8 @@
     // Reset the zoom limits in case a plugin had changed them previously. This
     // will also call us back which will cause us to send a message to
     // update WebContentsImpl.
-    webview()->zoomLimitsChanged(
-        WebView::zoomFactorToZoomLevel(kMinimumZoomFactor),
-        WebView::zoomFactorToZoomLevel(kMaximumZoomFactor));
+    webview()->zoomLimitsChanged(ZoomFactorToZoomLevel(kMinimumZoomFactor),
+                                 ZoomFactorToZoomLevel(kMaximumZoomFactor));
 
     // Set zoom level, but don't do it for full-page plugin since they don't use
     // the same zoom settings.
@@ -2234,7 +2235,7 @@
 }
 
 RenderWidgetFullscreenPepper* RenderViewImpl::CreatePepperFullscreenContainer(
-    webkit::ppapi::PluginInstanceImpl* plugin) {
+    PepperPluginInstanceImpl* plugin) {
 #if defined(ENABLE_PLUGINS)
   GURL active_url;
   if (webview() && webview()->mainFrame())
@@ -3970,6 +3971,12 @@
 
   gfx::Size size = webview()->contentsPreferredMinimumSize();
 
+  // In the presence of zoom, these sizes are still reported as if unzoomed,
+  // so we need to adjust.
+  double zoom_factor = ZoomLevelToZoomFactor(webview()->zoomLevel());
+  size.set_width(static_cast<int>(size.width() * zoom_factor));
+  size.set_height(static_cast<int>(size.height() * zoom_factor));
+
   if (size == preferred_size_)
     return;
 
@@ -5449,13 +5456,12 @@
   }
 }
 
-webkit::ppapi::PluginInstanceImpl*
-    RenderViewImpl::GetBitmapForOptimizedPluginPaint(
-        const gfx::Rect& paint_bounds,
-        TransportDIB** dib,
-        gfx::Rect* location,
-        gfx::Rect* clip,
-        float* scale_factor) {
+PepperPluginInstanceImpl* RenderViewImpl::GetBitmapForOptimizedPluginPaint(
+    const gfx::Rect& paint_bounds,
+    TransportDIB** dib,
+    gfx::Rect* location,
+    gfx::Rect* clip,
+    float* scale_factor) {
   return pepper_helper_->GetBitmapForOptimizedPluginPaint(
       paint_bounds, dib, location, clip, scale_factor);
 }
@@ -6029,9 +6035,9 @@
   bool remember = !webview()->mainFrame()->document().isPluginDocument();
 
   int minimum_percent = static_cast<int>(
-      WebView::zoomLevelToZoomFactor(minimum_level) * 100);
+      ZoomLevelToZoomFactor(minimum_level) * 100);
   int maximum_percent = static_cast<int>(
-      WebView::zoomLevelToZoomFactor(maximum_level) * 100);
+      ZoomLevelToZoomFactor(maximum_level) * 100);
 
   Send(new ViewHostMsg_UpdateZoomLimits(
       routing_id_, minimum_percent, maximum_percent, remember));
@@ -6050,6 +6056,14 @@
       GURL(webview()->mainFrame()->document().url())));
 }
 
+double RenderViewImpl::zoomLevelToZoomFactor(double zoom_level) const {
+  return ZoomLevelToZoomFactor(zoom_level);
+}
+
+double RenderViewImpl::zoomFactorToZoomLevel(double factor) const {
+  return ZoomFactorToZoomLevel(factor);
+}
+
 void RenderViewImpl::registerProtocolHandler(const WebString& scheme,
                                              const WebString& base_url,
                                              const WebString& url,
@@ -6084,6 +6098,12 @@
   return web_user_media_client_;
 }
 
+WebKit::WebMIDIClient* RenderViewImpl::webMIDIClient() {
+  if (!midi_dispatcher_)
+    midi_dispatcher_ = new MIDIDispatcher(this);
+  return midi_dispatcher_;
+}
+
 void RenderViewImpl::draggableRegionsChanged() {
   FOR_EACH_OBSERVER(
       RenderViewObserver,
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index d728cd4..e626f37 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -84,14 +84,6 @@
 struct SelectedFileInfo;
 }  // namespace ui
 
-namespace webkit {
-
-namespace ppapi {
-class PluginInstanceImpl;
-}  // namespace ppapi
-
-}  // namespace webkit
-
 namespace WebKit {
 class WebApplicationCacheHost;
 class WebApplicationCacheHostClient;
@@ -149,11 +141,13 @@
 class InputTagSpeechDispatcher;
 class JavaBridgeDispatcher;
 class LoadProgressTracker;
+class MIDIDispatcher;
 class MediaStreamClient;
 class MediaStreamDispatcher;
 class MouseLockDispatcher;
 class NavigationState;
 class NotificationProvider;
+class PepperPluginInstanceImpl;
 class RenderViewObserver;
 class RenderViewTest;
 class RendererAccessibility;
@@ -300,7 +294,7 @@
 
   // Creates a fullscreen container for a pepper plugin instance.
   RenderWidgetFullscreenPepper* CreatePepperFullscreenContainer(
-      webkit::ppapi::PluginInstanceImpl* plugin);
+      PepperPluginInstanceImpl* plugin);
 
   // Informs the render view that a PPAPI plugin has gained or lost focus.
   void PpapiPluginFocusChanged();
@@ -502,12 +496,15 @@
   virtual WebKit::WebDeviceOrientationClient* deviceOrientationClient();
   virtual void zoomLimitsChanged(double minimum_level, double maximum_level);
   virtual void zoomLevelChanged();
+  virtual double zoomLevelToZoomFactor(double zoom_level) const;
+  virtual double zoomFactorToZoomLevel(double factor) const;
   virtual void registerProtocolHandler(const WebKit::WebString& scheme,
                                        const WebKit::WebString& base_url,
                                        const WebKit::WebString& url,
                                        const WebKit::WebString& title);
   virtual WebKit::WebPageVisibilityState visibilityState() const;
   virtual WebKit::WebUserMediaClient* userMediaClient();
+  virtual WebKit::WebMIDIClient* webMIDIClient();
   virtual void draggableRegionsChanged();
 
 #if defined(OS_ANDROID)
@@ -755,7 +752,7 @@
   virtual void WillInitiatePaint() OVERRIDE;
   virtual void DidInitiatePaint() OVERRIDE;
   virtual void DidFlushPaint() OVERRIDE;
-  virtual webkit::ppapi::PluginInstanceImpl* GetBitmapForOptimizedPluginPaint(
+  virtual PepperPluginInstanceImpl* GetBitmapForOptimizedPluginPaint(
       const gfx::Rect& paint_bounds,
       TransportDIB** dib,
       gfx::Rect* location,
@@ -1415,6 +1412,9 @@
   MediaStreamClient* media_stream_client_;
   WebKit::WebUserMediaClient* web_user_media_client_;
 
+  // MIDIClient attached to this view; lazily initialized.
+  MIDIDispatcher* midi_dispatcher_;
+
   DevToolsAgent* devtools_agent_;
 
   // The current accessibility mode.
@@ -1535,9 +1535,9 @@
   // DOM automation bindings are enabled.
   scoped_ptr<DomAutomationController> dom_automation_controller_;
 
-   // Allows JS to read out a variety of internal various metrics. The JS object
-   // is only exposed when the stats collection bindings are enabled.
-   scoped_ptr<StatsCollectionController> stats_collection_controller_;
+  // Allows JS to read out a variety of internal various metrics. The JS object
+  // is only exposed when the stats collection bindings are enabled.
+  scoped_ptr<StatsCollectionController> stats_collection_controller_;
 
   // This field stores drag/drop related info for the event that is currently
   // being handled. If the current event results in starting a drag/drop
diff --git a/content/renderer/render_view_pepper_helper.cc b/content/renderer/render_view_pepper_helper.cc
index de27dfc..c98bcd1 100644
--- a/content/renderer/render_view_pepper_helper.cc
+++ b/content/renderer/render_view_pepper_helper.cc
@@ -17,13 +17,13 @@
   return NULL;
 }
 
-webkit::ppapi::PluginInstanceImpl*
-RenderViewPepperHelper::GetBitmapForOptimizedPluginPaint(
-    const gfx::Rect& paint_bounds,
-    TransportDIB** dib,
-    gfx::Rect* location,
-    gfx::Rect* clip,
-    float* scale_factor) {
+PepperPluginInstanceImpl*
+    RenderViewPepperHelper::GetBitmapForOptimizedPluginPaint(
+        const gfx::Rect& paint_bounds,
+        TransportDIB** dib,
+        gfx::Rect* location,
+        gfx::Rect* clip,
+        float* scale_factor) {
   return NULL;
 }
 
diff --git a/content/renderer/render_view_pepper_helper.h b/content/renderer/render_view_pepper_helper.h
index 4d13c3e..54d33d5 100644
--- a/content/renderer/render_view_pepper_helper.h
+++ b/content/renderer/render_view_pepper_helper.h
@@ -30,12 +30,6 @@
 class Range;
 }
 
-namespace webkit {
-namespace ppapi {
-class PluginInstanceImpl;
-}
-}
-
 namespace WebKit {
 struct WebCompositionUnderline;
 struct WebPluginParams;
@@ -43,6 +37,7 @@
 }
 
 namespace content {
+class PepperPluginInstanceImpl;
 struct WebPluginInfo;
 
 class CONTENT_EXPORT RenderViewPepperHelper {
@@ -56,7 +51,7 @@
 
   // Called by RenderView to implement the corresponding function in its base
   // class RenderWidget (see that for more).
-  virtual webkit::ppapi::PluginInstanceImpl* GetBitmapForOptimizedPluginPaint(
+  virtual PepperPluginInstanceImpl* GetBitmapForOptimizedPluginPaint(
       const gfx::Rect& paint_bounds,
       TransportDIB** dib,
       gfx::Rect* location,
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index fa49316..605bae5 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -31,7 +31,7 @@
 #include "content/renderer/gpu/mailbox_output_surface.h"
 #include "content/renderer/gpu/render_widget_compositor.h"
 #include "content/renderer/ime_event_guard.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/render_process.h"
 #include "content/renderer/render_process_visibility_manager.h"
 #include "content/renderer/render_thread_impl.h"
@@ -965,7 +965,7 @@
   TransportDIB* optimized_dib = NULL;
   gfx::Rect optimized_copy_rect, optimized_copy_location;
   float dib_scale_factor;
-  webkit::ppapi::PluginInstanceImpl* optimized_instance =
+  PepperPluginInstanceImpl* optimized_instance =
       GetBitmapForOptimizedPluginPaint(rect, &optimized_dib,
                                        &optimized_copy_location,
                                        &optimized_copy_rect,
@@ -2021,13 +2021,12 @@
   }
 }
 
-webkit::ppapi::PluginInstanceImpl*
-    RenderWidget::GetBitmapForOptimizedPluginPaint(
-        const gfx::Rect& paint_bounds,
-        TransportDIB** dib,
-        gfx::Rect* location,
-        gfx::Rect* clip,
-        float* scale_factor) {
+PepperPluginInstanceImpl* RenderWidget::GetBitmapForOptimizedPluginPaint(
+    const gfx::Rect& paint_bounds,
+    TransportDIB** dib,
+    gfx::Rect* location,
+    gfx::Rect* clip,
+    float* scale_factor) {
   // Bare RenderWidgets don't support optimized plugin painting.
   return NULL;
 }
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index 640b82b..4f20cc6 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -64,13 +64,8 @@
 class Range;
 }
 
-namespace webkit {
-namespace ppapi {
-class PluginInstanceImpl;
-}  // namespace ppapi
-}  // namespace webkit
-
 namespace content {
+class PepperPluginInstanceImpl;
 class RenderWidgetCompositor;
 class RenderWidgetTest;
 struct GpuRenderingStats;
@@ -381,7 +376,7 @@
   //
   // A return value of null means optimized painting can not be used and we
   // should continue with the normal painting code path.
-  virtual webkit::ppapi::PluginInstanceImpl* GetBitmapForOptimizedPluginPaint(
+  virtual PepperPluginInstanceImpl* GetBitmapForOptimizedPluginPaint(
       const gfx::Rect& paint_bounds,
       TransportDIB** dib,
       gfx::Rect* location,
diff --git a/content/renderer/render_widget_fullscreen_pepper.cc b/content/renderer/render_widget_fullscreen_pepper.cc
index 1eb0ff9..7a04ac7 100644
--- a/content/renderer/render_widget_fullscreen_pepper.cc
+++ b/content/renderer/render_widget_fullscreen_pepper.cc
@@ -14,8 +14,8 @@
 #include "content/public/common/content_switches.h"
 #include "content/renderer/gpu/render_widget_compositor.h"
 #include "content/renderer/pepper/pepper_platform_context_3d_impl.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
 #include "content/renderer/pepper/plugin_delegate.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
 #include "content/renderer/render_thread_impl.h"
 #include "gpu/command_buffer/client/gles2_implementation.h"
 #include "skia/ext/platform_canvas.h"
@@ -348,7 +348,8 @@
 
 // static
 RenderWidgetFullscreenPepper* RenderWidgetFullscreenPepper::Create(
-    int32 opener_id, webkit::ppapi::PluginInstanceImpl* plugin,
+    int32 opener_id,
+    PepperPluginInstanceImpl* plugin,
     const GURL& active_url,
     const WebKit::WebScreenInfo& screen_info) {
   DCHECK_NE(MSG_ROUTING_NONE, opener_id);
@@ -360,7 +361,7 @@
 }
 
 RenderWidgetFullscreenPepper::RenderWidgetFullscreenPepper(
-    webkit::ppapi::PluginInstanceImpl* plugin,
+    PepperPluginInstanceImpl* plugin,
     const GURL& active_url,
     const WebKit::WebScreenInfo& screen_info)
     : RenderWidgetFullscreen(screen_info),
@@ -467,13 +468,13 @@
   RenderWidget::Close();
 }
 
-webkit::ppapi::PluginInstanceImpl*
-RenderWidgetFullscreenPepper::GetBitmapForOptimizedPluginPaint(
-    const gfx::Rect& paint_bounds,
-    TransportDIB** dib,
-    gfx::Rect* location,
-    gfx::Rect* clip,
-    float* scale_factor) {
+PepperPluginInstanceImpl*
+    RenderWidgetFullscreenPepper::GetBitmapForOptimizedPluginPaint(
+        const gfx::Rect& paint_bounds,
+        TransportDIB** dib,
+        gfx::Rect* location,
+        gfx::Rect* clip,
+        float* scale_factor) {
   if (plugin_ && plugin_->GetBitmapForOptimizedPluginPaint(
           paint_bounds, dib, location, clip, scale_factor)) {
     return plugin_;
diff --git a/content/renderer/render_widget_fullscreen_pepper.h b/content/renderer/render_widget_fullscreen_pepper.h
index 840a979..29980e8 100644
--- a/content/renderer/render_widget_fullscreen_pepper.h
+++ b/content/renderer/render_widget_fullscreen_pepper.h
@@ -11,30 +11,22 @@
 #include "content/renderer/render_widget_fullscreen.h"
 #include "third_party/WebKit/public/web/WebWidget.h"
 
-namespace webkit {
-namespace ppapi {
-
-class PluginInstanceImpl;
-
-}  // namespace ppapi
-}  // namespace webkit
-
 namespace WebKit {
 class WebLayer;
 }
 
 namespace content {
+class PepperPluginInstanceImpl;
 
 // A RenderWidget that hosts a fullscreen pepper plugin. This provides a
 // FullscreenContainer that the plugin instance can callback into to e.g.
 // invalidate rects.
-class RenderWidgetFullscreenPepper :
-    public RenderWidgetFullscreen,
-    public webkit::ppapi::FullscreenContainer {
+class RenderWidgetFullscreenPepper : public RenderWidgetFullscreen,
+                                     public FullscreenContainer {
  public:
   static RenderWidgetFullscreenPepper* Create(
       int32 opener_id,
-      webkit::ppapi::PluginInstanceImpl* plugin,
+      PepperPluginInstanceImpl* plugin,
       const GURL& active_url,
       const WebKit::WebScreenInfo& screen_info);
 
@@ -51,7 +43,7 @@
   virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
 
   // Could be NULL when this widget is closing.
-  webkit::ppapi::PluginInstanceImpl* plugin() const { return plugin_; }
+  PepperPluginInstanceImpl* plugin() const { return plugin_; }
 
   MouseLockDispatcher* mouse_lock_dispatcher() const {
     return mouse_lock_dispatcher_.get();
@@ -60,7 +52,7 @@
   bool is_compositing() const { return !!layer_; }
 
  protected:
-  RenderWidgetFullscreenPepper(webkit::ppapi::PluginInstanceImpl* plugin,
+  RenderWidgetFullscreenPepper(PepperPluginInstanceImpl* plugin,
                                const GURL& active_url,
                                const WebKit::WebScreenInfo& screen_info);
   virtual ~RenderWidgetFullscreenPepper();
@@ -70,7 +62,7 @@
   virtual void DidInitiatePaint() OVERRIDE;
   virtual void DidFlushPaint() OVERRIDE;
   virtual void Close() OVERRIDE;
-  virtual webkit::ppapi::PluginInstanceImpl* GetBitmapForOptimizedPluginPaint(
+  virtual PepperPluginInstanceImpl* GetBitmapForOptimizedPluginPaint(
       const gfx::Rect& paint_bounds,
       TransportDIB** dib,
       gfx::Rect* location,
@@ -90,7 +82,7 @@
   GURL active_url_;
 
   // The plugin instance this widget wraps.
-  webkit::ppapi::PluginInstanceImpl* plugin_;
+  PepperPluginInstanceImpl* plugin_;
 
   WebKit::WebLayer* layer_;
 
diff --git a/content/renderer/renderer_main.cc b/content/renderer/renderer_main.cc
index b179545..d1b7340 100644
--- a/content/renderer/renderer_main.cc
+++ b/content/renderer/renderer_main.cc
@@ -28,7 +28,6 @@
 #include "content/public/renderer/content_renderer_client.h"
 #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h"
 #include "content/renderer/pepper/pepper_plugin_registry.h"
-#include "content/renderer/pepper/ppapi_interface_factory.h"
 #include "content/renderer/render_process_impl.h"
 #include "content/renderer/render_thread_impl.h"
 #include "content/renderer/renderer_main_platform_delegate.h"
@@ -108,11 +107,6 @@
   DISALLOW_COPY_AND_ASSIGN(MemoryObserver);
 };
 
-
-const void* ContentPPAPIInterfaceFactory(const std::string& interface_name) {
-  return GetContentClient()->renderer()->CreatePPAPIInterface(interface_name);
-}
-
 }  // namespace
 
 // mainline routine for running as the Renderer process
@@ -202,10 +196,6 @@
   }
 
 #if defined(ENABLE_PLUGINS)
-  webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager =
-      webkit::ppapi::PpapiInterfaceFactoryManager::GetInstance();
-  factory_manager->RegisterFactory(ContentPPAPIInterfaceFactory);
-
   // Load pepper plugins before engaging the sandbox.
   PepperPluginRegistry::GetInstance();
 #endif
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc
index 211c567..5a868ce 100644
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc
@@ -1137,6 +1137,12 @@
 //------------------------------------------------------------------------------
 
 WebKit::WebCrypto* RendererWebKitPlatformSupportImpl::crypto() {
+  // Use a mock implementation for testing in-progress work.
+  WebKit::WebCrypto* crypto =
+      GetContentClient()->renderer()->OverrideWebCrypto();
+  if (crypto)
+    return crypto;
+
   if (!web_crypto_)
     web_crypto_.reset(new WebCryptoImpl());
   return web_crypto_.get();
diff --git a/content/renderer/webplugin_delegate_proxy.h b/content/renderer/webplugin_delegate_proxy.h
index c0838a2..46bf027 100644
--- a/content/renderer/webplugin_delegate_proxy.h
+++ b/content/renderer/webplugin_delegate_proxy.h
@@ -35,12 +35,6 @@
 class WaitableEvent;
 }
 
-namespace webkit {
-namespace npapi {
-class WebPlugin;
-}
-}
-
 namespace content {
 class NPObjectStub;
 class PluginChannelHost;
diff --git a/content/shell/renderer/shell_content_renderer_client.cc b/content/shell/renderer/shell_content_renderer_client.cc
index a1522b9..657426f 100644
--- a/content/shell/renderer/shell_content_renderer_client.cc
+++ b/content/shell/renderer/shell_content_renderer_client.cc
@@ -170,6 +170,14 @@
   return clipboard_.get();
 }
 
+WebKit::WebCrypto* ShellContentRendererClient::OverrideWebCrypto() {
+  if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
+    return NULL;
+  WebTestInterfaces* interfaces =
+      ShellRenderProcessObserver::GetInstance()->test_interfaces();
+  return interfaces->crypto();
+}
+
 WebHyphenator* ShellContentRendererClient::OverrideWebHyphenator() {
   if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
     return NULL;
diff --git a/content/shell/renderer/shell_content_renderer_client.h b/content/shell/renderer/shell_content_renderer_client.h
index ffac51d..768629c 100644
--- a/content/shell/renderer/shell_content_renderer_client.h
+++ b/content/shell/renderer/shell_content_renderer_client.h
@@ -57,6 +57,7 @@
   virtual WebKit::WebAudioDevice* OverrideCreateAudioDevice(
       double sample_rate) OVERRIDE;
   virtual WebKit::WebClipboard* OverrideWebClipboard() OVERRIDE;
+  virtual WebKit::WebCrypto* OverrideWebCrypto() OVERRIDE;
   virtual WebKit::WebHyphenator* OverrideWebHyphenator() OVERRIDE;
   virtual WebKit::WebThemeEngine* OverrideThemeEngine() OVERRIDE;
   virtual bool AllowBrowserPlugin(
diff --git a/content/shell/webkit_test_controller.cc b/content/shell/webkit_test_controller.cc
index 851bceb..8189db2 100644
--- a/content/shell/webkit_test_controller.cc
+++ b/content/shell/webkit_test_controller.cc
@@ -9,7 +9,6 @@
 #include "base/base64.h"
 #include "base/command_line.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process_util.h"
 #include "base/run_loop.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/stringprintf.h"
diff --git a/content/test/data/browser_plugin_embedder_guest_unresponsive.html b/content/test/data/browser_plugin_embedder_guest_unresponsive.html
deleted file mode 100644
index f6e819b..0000000
--- a/content/test/data/browser_plugin_embedder_guest_unresponsive.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<script type="text/javascript">
-var unresponsiveCalled = false;
-var responsiveCalled = false;
-function SetSrc(src) {
-  plugin = document.getElementById('plugin');
-  plugin.src = src;
-}
-function GuestUnresponsive(evt) {
-  unresponsiveCalled = true;
-}
-
-function GuestResponsive(evt) {
-  responsiveCalled = true;
-  document.title = "done";
-}
-</script>
-
-<!-- The plugin size is same as the browser's size -->
-<object id="plugin"
-    tabindex="0"
-    type="application/browser-plugin"
-    style="height: 100%; width: 100%; border: 0px"></object>
-
-<script>
-  var plugin = document.getElementById('plugin');
-  plugin.addEventListener('-internal-unresponsive', GuestUnresponsive);
-  plugin.addEventListener('-internal-responsive', GuestResponsive);
-  plugin.addEventListener('-internal-instanceid-allocated', function(e) {
-    plugin['-internal-attach']({});
-  });
-</script>
diff --git a/content/zygote/zygote_linux.cc b/content/zygote/zygote_linux.cc
index 8930022..abb52ae 100644
--- a/content/zygote/zygote_linux.cc
+++ b/content/zygote/zygote_linux.cc
@@ -19,7 +19,7 @@
 #include "base/posix/eintr_wrapper.h"
 #include "base/posix/global_descriptors.h"
 #include "base/posix/unix_domain_socket_linux.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
 #include "content/common/sandbox_linux.h"
 #include "content/common/set_process_title.h"
 #include "content/common/zygote_commands_linux.h"
diff --git a/content/zygote/zygote_linux.h b/content/zygote/zygote_linux.h
index d9e515a..3b175ac 100644
--- a/content/zygote/zygote_linux.h
+++ b/content/zygote/zygote_linux.h
@@ -9,7 +9,7 @@
 #include <vector>
 
 #include "base/containers/hash_tables.h"
-#include "base/process.h"
+#include "base/process/process.h"
 
 class Pickle;
 class PickleIterator;
diff --git a/content/zygote/zygote_main_linux.cc b/content/zygote/zygote_main_linux.cc
index 0df288f..1f0e9f5 100644
--- a/content/zygote/zygote_main_linux.cc
+++ b/content/zygote/zygote_main_linux.cc
@@ -24,7 +24,6 @@
 #include "base/pickle.h"
 #include "base/posix/eintr_wrapper.h"
 #include "base/posix/unix_domain_socket_linux.h"
-#include "base/process_util.h"
 #include "base/rand_util.h"
 #include "base/sys_info.h"
 #include "build/build_config.h"