Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: webkit/glue/plugins/pepper_plugin_module.cc

Issue 2800028: Simplfy Pepepr2 bolierplate code. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Updated. Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/glue/plugins/pepper_plugin_module.h" 5 #include "webkit/glue/plugins/pepper_plugin_module.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 &GetTime, 110 &GetTime,
111 &CallOnMainThread 111 &CallOnMainThread
112 }; 112 };
113 113
114 // PPB_Testing ----------------------------------------------------------------- 114 // PPB_Testing -----------------------------------------------------------------
115 115
116 bool ReadImageData(PP_Resource device_context_2d, 116 bool ReadImageData(PP_Resource device_context_2d,
117 PP_Resource image, 117 PP_Resource image,
118 int32_t x, int32_t y) { 118 int32_t x, int32_t y) {
119 scoped_refptr<DeviceContext2D> context( 119 scoped_refptr<DeviceContext2D> context(
120 ResourceTracker::Get()->GetAsDeviceContext2D(device_context_2d)); 120 Resource::GetAs<DeviceContext2D>(device_context_2d));
121 if (!context.get()) 121 if (!context.get())
122 return false; 122 return false;
123 return context->ReadImageData(image, x, y); 123 return context->ReadImageData(image, x, y);
124 } 124 }
125 125
126 void RunMessageLoop() { 126 void RunMessageLoop() {
127 bool old_state = MessageLoop::current()->NestableTasksAllowed(); 127 bool old_state = MessageLoop::current()->NestableTasksAllowed();
128 MessageLoop::current()->SetNestableTasksAllowed(true); 128 MessageLoop::current()->SetNestableTasksAllowed(true);
129 MessageLoop::current()->Run(); 129 MessageLoop::current()->Run();
130 MessageLoop::current()->SetNestableTasksAllowed(old_state); 130 MessageLoop::current()->SetNestableTasksAllowed(old_state);
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 333
334 void PluginModule::InstanceCreated(PluginInstance* instance) { 334 void PluginModule::InstanceCreated(PluginInstance* instance) {
335 instances_.insert(instance); 335 instances_.insert(instance);
336 } 336 }
337 337
338 void PluginModule::InstanceDeleted(PluginInstance* instance) { 338 void PluginModule::InstanceDeleted(PluginInstance* instance) {
339 instances_.erase(instance); 339 instances_.erase(instance);
340 } 340 }
341 341
342 } // namespace pepper 342 } // namespace pepper
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698