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

Side by Side Diff: third_party/WebKit/Source/web/WebHelperPluginImpl.cpp

Issue 2041263002: Remove the use of OwnedPtrDeleter in WebHelperPlugin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | third_party/WebKit/Source/web/tests/WebHelperPluginTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 23 matching lines...) Expand all
34 #include "core/loader/FrameLoader.h" 34 #include "core/loader/FrameLoader.h"
35 #include "core/loader/FrameLoaderClient.h" 35 #include "core/loader/FrameLoaderClient.h"
36 #include "public/web/WebPlugin.h" 36 #include "public/web/WebPlugin.h"
37 #include "web/WebLocalFrameImpl.h" 37 #include "web/WebLocalFrameImpl.h"
38 #include "web/WebPluginContainerImpl.h" 38 #include "web/WebPluginContainerImpl.h"
39 39
40 namespace blink { 40 namespace blink {
41 41
42 DEFINE_TYPE_CASTS(WebHelperPluginImpl, WebHelperPlugin, plugin, true, true); 42 DEFINE_TYPE_CASTS(WebHelperPluginImpl, WebHelperPlugin, plugin, true, true);
43 43
44 WebHelperPlugin* WebHelperPlugin::create(const WebString& pluginType, WebLocalFr ame* frame) 44 WebHelperPlugin* WebHelperPlugin::create(const WebString& pluginType, WebLocalFr ame* frame)
tzik 2016/06/07 06:57:18 Does our policy forbid to return std::unique_ptr h
Yuta Kitamura 2016/06/07 07:21:03 I think that's okay; would like to hear from dchen
dcheng 2016/06/07 17:10:32 For other Blink public APIs, we tried to avoid exp
45 { 45 {
46 OwnPtr<WebHelperPlugin> plugin = adoptPtr<WebHelperPlugin>(new WebHelperPlug inImpl()); 46 WebHelperPluginUniquePtr plugin(new WebHelperPluginImpl());
47 if (!toWebHelperPluginImpl(plugin.get())->initialize(pluginType, toWebLocalF rameImpl(frame))) 47 if (!toWebHelperPluginImpl(plugin.get())->initialize(pluginType, toWebLocalF rameImpl(frame)))
48 return 0; 48 return 0;
49 return plugin.leakPtr(); 49 return plugin.release();
50 } 50 }
51 51
52 WebHelperPluginImpl::WebHelperPluginImpl() 52 WebHelperPluginImpl::WebHelperPluginImpl()
53 : m_destructionTimer(this, &WebHelperPluginImpl::reallyDestroy) 53 : m_destructionTimer(this, &WebHelperPluginImpl::reallyDestroy)
54 { 54 {
55 } 55 }
56 56
57 WebHelperPluginImpl::~WebHelperPluginImpl() 57 WebHelperPluginImpl::~WebHelperPluginImpl()
58 { 58 {
59 // TODO(Oilpan): it is potentially problematic to support plugin 59 // TODO(Oilpan): it is potentially problematic to support plugin
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 } 106 }
107 107
108 WebPlugin* WebHelperPluginImpl::getPlugin() 108 WebPlugin* WebHelperPluginImpl::getPlugin()
109 { 109 {
110 DCHECK(m_pluginContainer); 110 DCHECK(m_pluginContainer);
111 DCHECK(m_pluginContainer->plugin()); 111 DCHECK(m_pluginContainer->plugin());
112 return m_pluginContainer->plugin(); 112 return m_pluginContainer->plugin();
113 } 113 }
114 114
115 } // namespace blink 115 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebHelperPluginTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698