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

Side by Side Diff: content/renderer/browser_plugin/browser_plugin.cc

Issue 14081010: Cleanup: Remove unnecessary ".get()" from scoped_ptrs<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix some gtk issues Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/browser_plugin/browser_plugin.h" 5 #include "content/renderer/browser_plugin/browser_plugin.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/json/json_string_value_serializer.h" 8 #include "base/json/json_string_value_serializer.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 } 411 }
412 412
413 // static 413 // static
414 bool BrowserPlugin::UsesDamageBuffer( 414 bool BrowserPlugin::UsesDamageBuffer(
415 const BrowserPluginMsg_UpdateRect_Params& params) { 415 const BrowserPluginMsg_UpdateRect_Params& params) {
416 return params.damage_buffer_sequence_id != 0 || params.needs_ack; 416 return params.damage_buffer_sequence_id != 0 || params.needs_ack;
417 } 417 }
418 418
419 bool BrowserPlugin::UsesPendingDamageBuffer( 419 bool BrowserPlugin::UsesPendingDamageBuffer(
420 const BrowserPluginMsg_UpdateRect_Params& params) { 420 const BrowserPluginMsg_UpdateRect_Params& params) {
421 if (!pending_damage_buffer_.get()) 421 if (!pending_damage_buffer_)
422 return false; 422 return false;
423 return damage_buffer_sequence_id_ == params.damage_buffer_sequence_id; 423 return damage_buffer_sequence_id_ == params.damage_buffer_sequence_id;
424 } 424 }
425 425
426 void BrowserPlugin::SetInstanceID(int instance_id, bool new_guest) { 426 void BrowserPlugin::SetInstanceID(int instance_id, bool new_guest) {
427 CHECK(instance_id != browser_plugin::kInstanceIDNone); 427 CHECK(instance_id != browser_plugin::kInstanceIDNone);
428 before_first_navigation_ = false; 428 before_first_navigation_ = false;
429 instance_id_ = instance_id; 429 instance_id_ = instance_id;
430 browser_plugin_manager()->AddBrowserPlugin(instance_id, this); 430 browser_plugin_manager()->AddBrowserPlugin(instance_id, this);
431 431
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 container_ = NULL; 1176 container_ = NULL;
1177 if (compositing_helper_) 1177 if (compositing_helper_)
1178 compositing_helper_->OnContainerDestroy(); 1178 compositing_helper_->OnContainerDestroy();
1179 // Will be a no-op if the mouse is not currently locked. 1179 // Will be a no-op if the mouse is not currently locked.
1180 if (render_view_) 1180 if (render_view_)
1181 render_view_->mouse_lock_dispatcher()->OnLockTargetDestroyed(this); 1181 render_view_->mouse_lock_dispatcher()->OnLockTargetDestroyed(this);
1182 MessageLoop::current()->DeleteSoon(FROM_HERE, this); 1182 MessageLoop::current()->DeleteSoon(FROM_HERE, this);
1183 } 1183 }
1184 1184
1185 NPObject* BrowserPlugin::scriptableObject() { 1185 NPObject* BrowserPlugin::scriptableObject() {
1186 if (!bindings_.get()) 1186 if (!bindings_)
1187 return NULL; 1187 return NULL;
1188 1188
1189 NPObject* browser_plugin_np_object(bindings_->np_object()); 1189 NPObject* browser_plugin_np_object(bindings_->np_object());
1190 // The object is expected to be retained before it is returned. 1190 // The object is expected to be retained before it is returned.
1191 WebKit::WebBindings::retainObject(browser_plugin_np_object); 1191 WebKit::WebBindings::retainObject(browser_plugin_np_object);
1192 return browser_plugin_np_object; 1192 return browser_plugin_np_object;
1193 } 1193 }
1194 1194
1195 bool BrowserPlugin::supportsKeyboardFocus() const { 1195 bool BrowserPlugin::supportsKeyboardFocus() const {
1196 return true; 1196 return true;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1337 size_t size = 1337 size_t size =
1338 std::max(sizeof(unsigned int), 1338 std::max(sizeof(unsigned int),
1339 static_cast<size_t>(view_size.height() * 1339 static_cast<size_t>(view_size.height() *
1340 stride * 1340 stride *
1341 GetDeviceScaleFactor() * 1341 GetDeviceScaleFactor() *
1342 GetDeviceScaleFactor())); 1342 GetDeviceScaleFactor()));
1343 1343
1344 params->damage_buffer_size = size; 1344 params->damage_buffer_size = size;
1345 pending_damage_buffer_.reset( 1345 pending_damage_buffer_.reset(
1346 CreateDamageBuffer(size, &params->damage_buffer_handle)); 1346 CreateDamageBuffer(size, &params->damage_buffer_handle));
1347 if (!pending_damage_buffer_.get()) 1347 if (!pending_damage_buffer_)
1348 NOTREACHED(); 1348 NOTREACHED();
1349 params->damage_buffer_sequence_id = ++damage_buffer_sequence_id_; 1349 params->damage_buffer_sequence_id = ++damage_buffer_sequence_id_;
1350 } 1350 }
1351 1351
1352 void BrowserPlugin::GetDamageBufferWithSizeParams( 1352 void BrowserPlugin::GetDamageBufferWithSizeParams(
1353 BrowserPluginHostMsg_AutoSize_Params* auto_size_params, 1353 BrowserPluginHostMsg_AutoSize_Params* auto_size_params,
1354 BrowserPluginHostMsg_ResizeGuest_Params* resize_guest_params) { 1354 BrowserPluginHostMsg_ResizeGuest_Params* resize_guest_params) {
1355 if (auto_size_params) 1355 if (auto_size_params)
1356 PopulateAutoSizeParameters(auto_size_params, GetAutoSizeAttribute()); 1356 PopulateAutoSizeParameters(auto_size_params, GetAutoSizeAttribute());
1357 gfx::Size view_size = (auto_size_params && auto_size_params->enable) ? 1357 gfx::Size view_size = (auto_size_params && auto_size_params->enable) ?
1358 auto_size_params->max_size : gfx::Size(width(), height()); 1358 auto_size_params->max_size : gfx::Size(width(), height());
1359 if (view_size.IsEmpty()) 1359 if (view_size.IsEmpty())
1360 return; 1360 return;
1361 resize_ack_received_ = false; 1361 resize_ack_received_ = false;
1362 PopulateResizeGuestParameters(resize_guest_params, view_size); 1362 PopulateResizeGuestParameters(resize_guest_params, view_size);
1363 } 1363 }
1364 1364
1365 #if defined(OS_POSIX) 1365 #if defined(OS_POSIX)
1366 base::SharedMemory* BrowserPlugin::CreateDamageBuffer( 1366 base::SharedMemory* BrowserPlugin::CreateDamageBuffer(
1367 const size_t size, 1367 const size_t size,
1368 base::SharedMemoryHandle* damage_buffer_handle) { 1368 base::SharedMemoryHandle* damage_buffer_handle) {
1369 scoped_ptr<base::SharedMemory> shared_buf( 1369 scoped_ptr<base::SharedMemory> shared_buf(
1370 content::RenderThread::Get()->HostAllocateSharedMemoryBuffer( 1370 content::RenderThread::Get()->HostAllocateSharedMemoryBuffer(
1371 size).release()); 1371 size).release());
1372 1372
1373 if (shared_buf.get()) { 1373 if (shared_buf) {
1374 if (shared_buf->Map(size)) { 1374 if (shared_buf->Map(size)) {
1375 // Insert the magic word. 1375 // Insert the magic word.
1376 *static_cast<unsigned int*>(shared_buf->memory()) = 0xdeadbeef; 1376 *static_cast<unsigned int*>(shared_buf->memory()) = 0xdeadbeef;
1377 shared_buf->ShareToProcess(base::GetCurrentProcessHandle(), 1377 shared_buf->ShareToProcess(base::GetCurrentProcessHandle(),
1378 damage_buffer_handle); 1378 damage_buffer_handle);
1379 return shared_buf.release(); 1379 return shared_buf.release();
1380 } 1380 }
1381 } 1381 }
1382 NOTREACHED(); 1382 NOTREACHED();
1383 return NULL; 1383 return NULL;
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1536 const WebKit::WebMouseEvent& event) { 1536 const WebKit::WebMouseEvent& event) {
1537 browser_plugin_manager()->Send( 1537 browser_plugin_manager()->Send(
1538 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, 1538 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_,
1539 instance_id_, 1539 instance_id_,
1540 plugin_rect_, 1540 plugin_rect_,
1541 &event)); 1541 &event));
1542 return true; 1542 return true;
1543 } 1543 }
1544 1544
1545 } // namespace content 1545 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/active_notification_tracker.cc ('k') | content/renderer/browser_plugin/mock_browser_plugin_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698