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

Side by Side Diff: content/browser/web_contents/web_contents_impl.h

Issue 1685343004: Don't call WebContents::DownloadImage() callback if the WebContents were deleted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 void AddDestructionObserver(WebContentsImpl* web_contents); 813 void AddDestructionObserver(WebContentsImpl* web_contents);
814 814
815 // Deletes and removes from the map a destruction observer 815 // Deletes and removes from the map a destruction observer
816 // watching |web_contents|. No-op if there is no such observer. 816 // watching |web_contents|. No-op if there is no such observer.
817 void RemoveDestructionObserver(WebContentsImpl* web_contents); 817 void RemoveDestructionObserver(WebContentsImpl* web_contents);
818 818
819 // Traverses all the RenderFrameHosts in the FrameTree and creates a set 819 // Traverses all the RenderFrameHosts in the FrameTree and creates a set
820 // all the unique RenderWidgetHostViews. 820 // all the unique RenderWidgetHostViews.
821 std::set<RenderWidgetHostView*> GetRenderWidgetHostViewsInTree(); 821 std::set<RenderWidgetHostView*> GetRenderWidgetHostViewsInTree();
822 822
823 // Called with the result of a DownloadImage() request.
824 void OnDidDownloadImage(const ImageDownloadCallback& callback,
825 int id,
826 const GURL& image_url,
827 image_downloader::DownloadResultPtr result);
828
823 // Callback function when showing JavaScript dialogs. Takes in a routing ID 829 // Callback function when showing JavaScript dialogs. Takes in a routing ID
824 // pair to identify the RenderFrameHost that opened the dialog, because it's 830 // pair to identify the RenderFrameHost that opened the dialog, because it's
825 // possible for the RenderFrameHost to be deleted by the time this is called. 831 // possible for the RenderFrameHost to be deleted by the time this is called.
826 void OnDialogClosed(int render_process_id, 832 void OnDialogClosed(int render_process_id,
827 int render_frame_id, 833 int render_frame_id,
828 IPC::Message* reply_msg, 834 IPC::Message* reply_msg,
829 bool dialog_was_suppressed, 835 bool dialog_was_suppressed,
830 bool success, 836 bool success,
831 const base::string16& user_input); 837 const base::string16& user_input);
832 838
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1303 // Manages media players, CDMs, and power save blockers for media. 1309 // Manages media players, CDMs, and power save blockers for media.
1304 scoped_ptr<MediaWebContentsObserver> media_web_contents_observer_; 1310 scoped_ptr<MediaWebContentsObserver> media_web_contents_observer_;
1305 1311
1306 scoped_ptr<RenderWidgetHostInputEventRouter> rwh_input_event_router_; 1312 scoped_ptr<RenderWidgetHostInputEventRouter> rwh_input_event_router_;
1307 1313
1308 PageImportanceSignals page_importance_signals_; 1314 PageImportanceSignals page_importance_signals_;
1309 1315
1310 bool page_scale_factor_is_one_; 1316 bool page_scale_factor_is_one_;
1311 1317
1312 base::WeakPtrFactory<WebContentsImpl> loading_weak_factory_; 1318 base::WeakPtrFactory<WebContentsImpl> loading_weak_factory_;
1319 base::WeakPtrFactory<WebContentsImpl> weak_factory_;
1313 1320
1314 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); 1321 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl);
1315 }; 1322 };
1316 1323
1317 // Dangerous methods which should never be made part of the public API, so we 1324 // Dangerous methods which should never be made part of the public API, so we
1318 // grant their use only to an explicit friend list (c++ attorney/client idiom). 1325 // grant their use only to an explicit friend list (c++ attorney/client idiom).
1319 class CONTENT_EXPORT WebContentsImpl::FriendZone { 1326 class CONTENT_EXPORT WebContentsImpl::FriendZone {
1320 private: 1327 private:
1321 friend class TestNavigationObserver; 1328 friend class TestNavigationObserver;
1322 friend class WebContentsAddedObserver; 1329 friend class WebContentsAddedObserver;
1323 friend class ContentBrowserSanityChecker; 1330 friend class ContentBrowserSanityChecker;
1324 1331
1325 FriendZone(); // Not instantiable. 1332 FriendZone(); // Not instantiable.
1326 1333
1327 // Adds/removes a callback called on creation of each new WebContents. 1334 // Adds/removes a callback called on creation of each new WebContents.
1328 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); 1335 static void AddCreatedCallbackForTesting(const CreatedCallback& callback);
1329 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); 1336 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback);
1330 1337
1331 DISALLOW_COPY_AND_ASSIGN(FriendZone); 1338 DISALLOW_COPY_AND_ASSIGN(FriendZone);
1332 }; 1339 };
1333 1340
1334 } // namespace content 1341 } // namespace content
1335 1342
1336 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 1343 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698