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

Side by Side Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 139603002: <webview>: Speculative crash fix (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adddressed comment Created 6 years, 11 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) 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/browser/browser_plugin/browser_plugin_guest.h" 5 #include "content/browser/browser_plugin/browser_plugin_guest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 333
334 DISALLOW_COPY_AND_ASSIGN(EmbedderWebContentsObserver); 334 DISALLOW_COPY_AND_ASSIGN(EmbedderWebContentsObserver);
335 }; 335 };
336 336
337 BrowserPluginGuest::BrowserPluginGuest( 337 BrowserPluginGuest::BrowserPluginGuest(
338 int instance_id, 338 int instance_id,
339 bool has_render_view, 339 bool has_render_view,
340 WebContentsImpl* web_contents, 340 WebContentsImpl* web_contents,
341 BrowserPluginGuest* opener) 341 BrowserPluginGuest* opener)
342 : WebContentsObserver(web_contents), 342 : WebContentsObserver(web_contents),
343 weak_ptr_factory_(this),
344 embedder_web_contents_(NULL), 343 embedder_web_contents_(NULL),
345 instance_id_(instance_id), 344 instance_id_(instance_id),
346 damage_buffer_sequence_id_(0), 345 damage_buffer_sequence_id_(0),
347 damage_buffer_size_(0), 346 damage_buffer_size_(0),
348 damage_buffer_scale_factor_(1.0f), 347 damage_buffer_scale_factor_(1.0f),
349 guest_device_scale_factor_(1.0f), 348 guest_device_scale_factor_(1.0f),
350 guest_hang_timeout_( 349 guest_hang_timeout_(
351 base::TimeDelta::FromMilliseconds(kHungRendererDelayMs)), 350 base::TimeDelta::FromMilliseconds(kHungRendererDelayMs)),
352 focused_(false), 351 focused_(false),
353 mouse_locked_(false), 352 mouse_locked_(false),
354 pending_lock_request_(false), 353 pending_lock_request_(false),
355 embedder_visible_(true), 354 embedder_visible_(true),
356 copy_request_id_(0), 355 copy_request_id_(0),
357 next_permission_request_id_(browser_plugin::kInvalidPermissionRequestID), 356 next_permission_request_id_(browser_plugin::kInvalidPermissionRequestID),
358 has_render_view_(has_render_view), 357 has_render_view_(has_render_view),
359 last_seen_auto_size_enabled_(false), 358 last_seen_auto_size_enabled_(false),
360 is_in_destruction_(false) { 359 is_in_destruction_(false),
360 weak_ptr_factory_(this) {
361 DCHECK(web_contents); 361 DCHECK(web_contents);
362 web_contents->SetDelegate(this); 362 web_contents->SetDelegate(this);
363 if (opener) 363 if (opener)
364 opener_ = opener->AsWeakPtr(); 364 opener_ = opener->AsWeakPtr();
365 GetWebContents()->GetBrowserPluginGuestManager()->AddGuest(instance_id_, 365 GetWebContents()->GetBrowserPluginGuestManager()->AddGuest(instance_id_,
366 GetWebContents()); 366 GetWebContents());
367 } 367 }
368 368
369 bool BrowserPluginGuest::AddMessageToConsole(WebContents* source, 369 bool BrowserPluginGuest::AddMessageToConsole(WebContents* source,
370 int32 level, 370 int32 level,
(...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after
1852 request_info.Set(browser_plugin::kRequestMethod, 1852 request_info.Set(browser_plugin::kRequestMethod,
1853 base::Value::CreateStringValue(request_method)); 1853 base::Value::CreateStringValue(request_method));
1854 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url)); 1854 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url));
1855 1855
1856 RequestPermission(BROWSER_PLUGIN_PERMISSION_TYPE_DOWNLOAD, 1856 RequestPermission(BROWSER_PLUGIN_PERMISSION_TYPE_DOWNLOAD,
1857 new DownloadRequest(callback), 1857 new DownloadRequest(callback),
1858 request_info); 1858 request_info);
1859 } 1859 }
1860 1860
1861 } // namespace content 1861 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.h ('k') | content/renderer/browser_plugin/browser_plugin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698