diff options
-rw-r--r-- | webkit/glue/SConscript | 1 | ||||
-rw-r--r-- | webkit/glue/context_menu_client_impl.cc | 16 | ||||
-rw-r--r-- | webkit/glue/glue.vcproj | 8 | ||||
-rw-r--r-- | webkit/glue/webdatasource.h | 4 | ||||
-rw-r--r-- | webkit/glue/webdatasource_impl.cc | 80 | ||||
-rw-r--r-- | webkit/glue/webdatasource_impl.h | 108 | ||||
-rw-r--r-- | webkit/glue/webdocumentloader_impl.cc | 72 | ||||
-rw-r--r-- | webkit/glue/webdocumentloader_impl.h | 106 | ||||
-rw-r--r-- | webkit/glue/webframe_impl.cc | 4 | ||||
-rw-r--r-- | webkit/glue/webframeloaderclient_impl.cc | 27 | ||||
-rw-r--r-- | webkit/glue/webresponse_impl.h | 1 | ||||
-rw-r--r-- | webkit/webkit.gyp | 2 |
12 files changed, 103 insertions, 326 deletions
diff --git a/webkit/glue/SConscript b/webkit/glue/SConscript index f59d7aa..3a6b91c 100644 --- a/webkit/glue/SConscript +++ b/webkit/glue/SConscript @@ -99,7 +99,6 @@ input_files = [ 'webdevtoolsclient_delegate.h', 'webdevtoolsclient_impl.cc', 'webdevtoolsclient_impl.h', - 'webdocumentloader_impl.cc', 'weberror_impl.cc', 'webframe_impl.cc', 'webframeloaderclient_impl.cc', diff --git a/webkit/glue/context_menu_client_impl.cc b/webkit/glue/context_menu_client_impl.cc index 64222c2..65089c9 100644 --- a/webkit/glue/context_menu_client_impl.cc +++ b/webkit/glue/context_menu_client_impl.cc @@ -25,7 +25,7 @@ MSVC_POP_WARNING(); #include "base/string_util.h" #include "webkit/glue/context_menu.h" #include "webkit/glue/glue_util.h" -#include "webkit/glue/webdocumentloader_impl.h" +#include "webkit/glue/webdatasource_impl.h" #include "webkit/glue/webresponse.h" #include "webkit/glue/weburlrequest_impl.h" #include "webkit/glue/webview_impl.h" @@ -124,8 +124,7 @@ static ContextNode GetTypeAndURLFromFrame(WebCore::Frame* frame, if (frame) { WebCore::DocumentLoader* dl = frame->loader()->documentLoader(); if (dl) { - WebDataSource* ds = static_cast<WebDocumentLoaderImpl*>(dl)-> - GetDataSource(); + WebDataSource* ds = WebDataSourceImpl::FromLoader(dl); if (ds) { node = page_node; *url = ds->HasUnreachableURL() ? ds->GetUnreachableURL() @@ -214,13 +213,10 @@ WebCore::PlatformMenuDescription // Now retrieve the security info. WebCore::DocumentLoader* dl = selected_frame->loader()->documentLoader(); - if (dl) { - WebDataSource* ds = static_cast<WebDocumentLoaderImpl*>(dl)-> - GetDataSource(); - if (ds) { - const WebResponse& response = ds->GetResponse(); - security_info = response.GetSecurityInfo(); - } + WebDataSource* ds = WebDataSourceImpl::FromLoader(dl); + if (ds) { + const WebResponse& response = ds->GetResponse(); + security_info = response.GetSecurityInfo(); } int edit_flags = ContextNode::CAN_DO_NONE; diff --git a/webkit/glue/glue.vcproj b/webkit/glue/glue.vcproj index 5f257ee..20bc1f4 100644 --- a/webkit/glue/glue.vcproj +++ b/webkit/glue/glue.vcproj @@ -613,14 +613,6 @@ >
</File>
<File
- RelativePath=".\webdocumentloader_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webdocumentloader_impl.h"
- >
- </File>
- <File
RelativePath=".\webdropdata.cc"
>
</File>
diff --git a/webkit/glue/webdatasource.h b/webkit/glue/webdatasource.h index b7c45a6..3bd29d1 100644 --- a/webkit/glue/webdatasource.h +++ b/webkit/glue/webdatasource.h @@ -18,6 +18,8 @@ struct PasswordForm; class WebDataSource { public: + virtual ~WebDataSource() {} + // Returns the frame that represents this data source. virtual WebFrame* GetWebFrame() = 0; @@ -79,8 +81,6 @@ class WebDataSource { // Returns the page title. virtual string16 GetPageTitle() const = 0; - - virtual ~WebDataSource() {} }; #endif // #ifndef WEBKIT_GLUE_WEBDATASOURCE_H_ diff --git a/webkit/glue/webdatasource_impl.cc b/webkit/glue/webdatasource_impl.cc index 6414d45..d3517d8 100644 --- a/webkit/glue/webdatasource_impl.cc +++ b/webkit/glue/webdatasource_impl.cc @@ -1,76 +1,47 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ +// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. #include "config.h" +#include "webkit/glue/webdatasource_impl.h" -#include "base/compiler_specific.h" - -MSVC_PUSH_WARNING_LEVEL(0); #include "KURL.h" #include "FrameLoadRequest.h" #include "ResourceRequest.h" -MSVC_POP_WARNING(); -#undef LOG +#undef LOG #include "base/string_util.h" #include "webkit/glue/glue_util.h" #include "webkit/glue/password_form.h" #include "webkit/glue/webdatasource_impl.h" -#include "webkit/glue/webdocumentloader_impl.h" #include "webkit/glue/webframe_impl.h" #include "webkit/glue/weburlrequest_impl.h" -// WebDataSource ---------------------------------------------------------------- - -WebDataSourceImpl::WebDataSourceImpl(WebFrameImpl* frame, - WebDocumentLoaderImpl* loader) : - frame_(frame), - loader_(loader), - initial_request_(loader->originalRequest()), - request_(loader->request()) { +// static +PassRefPtr<WebDataSourceImpl> WebDataSourceImpl::Create( + const WebCore::ResourceRequest& request, + const WebCore::SubstituteData& data) { + return adoptRef(new WebDataSourceImpl(request, data)); } -WebDataSourceImpl::~WebDataSourceImpl() { +WebDataSourceImpl::WebDataSourceImpl(const WebCore::ResourceRequest& request, + const WebCore::SubstituteData& data) + : WebCore::DocumentLoader(request, data), + form_submit_(false) { } -// static -WebDataSourceImpl* WebDataSourceImpl::CreateInstance( - WebFrameImpl* frame, WebDocumentLoaderImpl* loader) { - return new WebDataSourceImpl(frame, loader); +WebDataSourceImpl::~WebDataSourceImpl() { } -// WebDataSource WebFrame* WebDataSourceImpl::GetWebFrame() { - return frame_; + return WebFrameImpl::FromFrame(frame()); } const WebRequest& WebDataSourceImpl::GetInitialRequest() const { // WebKit may change the frame load request as it sees fit, so we must sync // our request object. initial_request_.set_frame_load_request( - WebCore::FrameLoadRequest(loader_->originalRequest())); + WebCore::FrameLoadRequest(originalRequest())); return initial_request_; } @@ -78,12 +49,12 @@ const WebRequest& WebDataSourceImpl::GetRequest() const { // WebKit may change the frame load request as it sees fit, so we must sync // our request object. request_.set_frame_load_request( - WebCore::FrameLoadRequest(loader_->request())); + WebCore::FrameLoadRequest(request())); return request_; } const WebResponse& WebDataSourceImpl::GetResponse() const { - response_.set_resource_response(loader_->response()); + response_.set_resource_response(response()); return response_; } @@ -93,13 +64,12 @@ void WebDataSourceImpl::SetExtraData(WebRequest::ExtraData* extra) { } GURL WebDataSourceImpl::GetUnreachableURL() const { - const WebCore::KURL& url = loader_->unreachableURL(); + const WebCore::KURL& url = unreachableURL(); return url.isEmpty() ? GURL() : webkit_glue::KURLToGURL(url); } bool WebDataSourceImpl::HasUnreachableURL() const { - const WebCore::KURL& url = loader_->unreachableURL(); - return !url.isEmpty(); + return !unreachableURL().isEmpty(); } const std::vector<GURL>& WebDataSourceImpl::GetRedirectChain() const { @@ -115,17 +85,17 @@ void WebDataSourceImpl::AppendRedirect(const GURL& url) { } const SearchableFormData* WebDataSourceImpl::GetSearchableFormData() const { - return loader_->searchable_form_data(); + return searchable_form_data(); } const PasswordForm* WebDataSourceImpl::GetPasswordFormData() const { - return loader_->password_form_data(); + return password_form_data(); } bool WebDataSourceImpl::IsFormSubmit() const { - return loader_->is_form_submit(); + return is_form_submit(); } string16 WebDataSourceImpl::GetPageTitle() const { - return webkit_glue::StringToString16(loader_->title()); + return webkit_glue::StringToString16(title()); } diff --git a/webkit/glue/webdatasource_impl.h b/webkit/glue/webdatasource_impl.h index 651abcb..4585a65 100644 --- a/webkit/glue/webdatasource_impl.h +++ b/webkit/glue/webdatasource_impl.h @@ -1,51 +1,31 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ +// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. #ifndef WEBKIT_GLUE_WEBDATASOURCE_IMPL_H_ #define WEBKIT_GLUE_WEBDATASOURCE_IMPL_H_ +#include "DocumentLoader.h" + +#include "base/scoped_ptr.h" +#include "webkit/glue/searchable_form_data.h" #include "webkit/glue/webdatasource.h" #include "webkit/glue/webresponse_impl.h" #include "webkit/glue/weburlrequest_impl.h" -struct PasswordForm; -class SearchableFormData; class WebFrameImpl; class WebDocumentLoaderImpl; -class WebDataSourceImpl : public WebDataSource { - public: - static WebDataSourceImpl* CreateInstance(WebFrameImpl* frame, - WebDocumentLoaderImpl* loader); - - protected: - WebDataSourceImpl(WebFrameImpl* frame, WebDocumentLoaderImpl* loader); - ~WebDataSourceImpl(); - +class WebDataSourceImpl : public WebCore::DocumentLoader, public WebDataSource { public: - // WebDataSource + static PassRefPtr<WebDataSourceImpl> Create(const WebCore::ResourceRequest&, + const WebCore::SubstituteData&); + + static WebDataSourceImpl* FromLoader(WebCore::DocumentLoader* loader) { + return static_cast<WebDataSourceImpl*>(loader); + } + + // WebDataSource methods: virtual WebFrame* GetWebFrame(); virtual const WebRequest& GetInitialRequest() const; virtual const WebRequest& GetRequest() const; @@ -53,8 +33,10 @@ class WebDataSourceImpl : public WebDataSource { virtual GURL GetUnreachableURL() const; virtual bool HasUnreachableURL() const; virtual const std::vector<GURL>& GetRedirectChain() const; - - // WebDataSourceImpl + virtual const SearchableFormData* GetSearchableFormData() const; + virtual const PasswordForm* GetPasswordFormData() const; + virtual bool IsFormSubmit() const; + virtual string16 GetPageTitle() const; // Called after creating a new data source if there is request info // available. Since we store copies of the WebRequests, the original @@ -66,16 +48,39 @@ class WebDataSourceImpl : public WebDataSource { void ClearRedirectChain(); void AppendRedirect(const GURL& url); - virtual const SearchableFormData* GetSearchableFormData() const; - virtual const PasswordForm* GetPasswordFormData() const; - - virtual bool IsFormSubmit() const; - - virtual string16 GetPageTitle() const; - -private: - WebFrameImpl* frame_; - WebDocumentLoaderImpl* loader_; + // Sets the SearchableFormData for this DocumentLoader. + // WebDocumentLoaderImpl will own the SearchableFormData. + void set_searchable_form_data(SearchableFormData* searchable_form_data) { + searchable_form_data_.reset(searchable_form_data); + } + // Returns the SearchableFormData for this DocumentLoader. + // WebDocumentLoaderImpl owns the returned SearchableFormData. + const SearchableFormData* searchable_form_data() const { + return searchable_form_data_.get(); + } + + // Sets the PasswordFormData for this DocumentLoader. + // WebDocumentLoaderImpl will own the PasswordFormData. + void set_password_form_data(PasswordForm* password_form_data) { + password_form_data_.reset(password_form_data); + } + // Returns the PasswordFormData for this DocumentLoader. + // WebDocumentLoaderImpl owns the returned PasswordFormData. + const PasswordForm* password_form_data() const { + return password_form_data_.get(); + } + + void set_form_submit(bool value) { + form_submit_ = value; + } + bool is_form_submit() const { + return form_submit_; + } + + private: + WebDataSourceImpl(const WebCore::ResourceRequest&, + const WebCore::SubstituteData&); + ~WebDataSourceImpl(); // Mutable because the const getters will magically sync these to the // latest version from WebKit. @@ -89,7 +94,12 @@ private: // who modifies this when to keep it up to date. std::vector<GURL> redirect_chain_; + scoped_ptr<const SearchableFormData> searchable_form_data_; + scoped_ptr<const PasswordForm> password_form_data_; + + bool form_submit_; + DISALLOW_COPY_AND_ASSIGN(WebDataSourceImpl); }; -#endif // #ifndef WEBKIT_GLUE_WEBDATASOURCE_IMPL_H_ +#endif // WEBKIT_GLUE_WEBDATASOURCE_IMPL_H_ diff --git a/webkit/glue/webdocumentloader_impl.cc b/webkit/glue/webdocumentloader_impl.cc deleted file mode 100644 index 81c91be..0000000 --- a/webkit/glue/webdocumentloader_impl.cc +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" - -#include "webkit/glue/webdocumentloader_impl.h" -#undef LOG - -#include "base/logging.h" - -using WebCore::DocumentLoader; -using WebCore::ResourceRequest; -using WebCore::SubstituteData; - -PassRefPtr<WebDocumentLoaderImpl> WebDocumentLoaderImpl::create( - const ResourceRequest& request, const SubstituteData& data) { - return adoptRef(new WebDocumentLoaderImpl(request, data)); -} - -WebDocumentLoaderImpl::WebDocumentLoaderImpl(const ResourceRequest& request, - const SubstituteData& data) - : DocumentLoader(request, data), - lock_history_(false), - form_submit_(false) { -} - -void WebDocumentLoaderImpl::SetDataSource(WebDataSource* datasource) { - datasource_.reset(datasource); -} - -WebDataSource* WebDocumentLoaderImpl::GetDataSource() const { - return datasource_.get(); -} - -// DocumentLoader -void WebDocumentLoaderImpl::attachToFrame() { - DocumentLoader::attachToFrame(); - if (detached_datasource_.get()) { - DCHECK(datasource_.get()); - datasource_.reset(detached_datasource_.release()); - } -} - -void WebDocumentLoaderImpl::detachFromFrame() { - DocumentLoader::detachFromFrame(); - detached_datasource_.reset(datasource_.release()); -} diff --git a/webkit/glue/webdocumentloader_impl.h b/webkit/glue/webdocumentloader_impl.h deleted file mode 100644 index 8a5b320..0000000 --- a/webkit/glue/webdocumentloader_impl.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef WEBKIT_GLUE_WEBDOCUMENTLOADER_IMPL_H__ -#define WEBKIT_GLUE_WEBDOCUMENTLOADER_IMPL_H__ - -#include "base/compiler_specific.h" - -MSVC_PUSH_WARNING_LEVEL(0); -#include "DocumentLoader.h" -MSVC_POP_WARNING(); - -#include "base/basictypes.h" -#include "base/scoped_ptr.h" -#include "webkit/glue/password_form.h" -#include "webkit/glue/searchable_form_data.h" -#include "webkit/glue/webdatasource.h" - -class WebDataSource; - -class WebDocumentLoaderImpl : public WebCore::DocumentLoader { - public: - static PassRefPtr<WebDocumentLoaderImpl> create( - const WebCore::ResourceRequest&, const WebCore::SubstituteData&); - - void SetDataSource(WebDataSource*); - WebDataSource* GetDataSource() const; - - void SetLockHistory(bool lock_history) { lock_history_ = lock_history; } - bool GetLockHistory() const { return lock_history_; } - - // DocumentLoader - virtual void attachToFrame(); - virtual void detachFromFrame(); - - // Sets the SearchableFormData for this DocumentLoader. - // WebDocumentLoaderImpl will own the SearchableFormData. - void set_searchable_form_data(SearchableFormData* searchable_form_data) { - searchable_form_data_.reset(searchable_form_data); - } - // Returns the SearchableFormData for this DocumentLoader. - // WebDocumentLoaderImpl owns the returned SearchableFormData. - const SearchableFormData* searchable_form_data() const { - return searchable_form_data_.get(); - } - - // Sets the PasswordFormData for this DocumentLoader. - // WebDocumentLoaderImpl will own the PasswordFormData. - void set_password_form_data(PasswordForm* password_form_data) { - password_form_data_.reset(password_form_data); - } - // Returns the PasswordFormData for this DocumentLoader. - // WebDocumentLoaderImpl owns the returned PasswordFormData. - const PasswordForm* password_form_data() const { - return password_form_data_.get(); - } - - void set_form_submit(bool value) { - form_submit_ = value; - } - bool is_form_submit() const { - return form_submit_; - } - - private: - WebDocumentLoaderImpl(const WebCore::ResourceRequest&, - const WebCore::SubstituteData&); - - scoped_ptr<WebDataSource> datasource_; - scoped_ptr<WebDataSource> detached_datasource_; - scoped_ptr<const SearchableFormData> searchable_form_data_; - scoped_ptr<const PasswordForm> password_form_data_; - - bool lock_history_; - - bool form_submit_; - - DISALLOW_EVIL_CONSTRUCTORS(WebDocumentLoaderImpl); -}; - -#endif // #ifndef WEBKIT_GLUE_WEBDOCUMENTLOADER_IMPL_H__ diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc index 4894a7d..4f71ec3 100644 --- a/webkit/glue/webframe_impl.cc +++ b/webkit/glue/webframe_impl.cc @@ -137,7 +137,6 @@ MSVC_POP_WARNING(); #include "webkit/glue/dom_operations_private.h" #include "webkit/glue/glue_serialize.h" #include "webkit/glue/glue_util.h" -#include "webkit/glue/webdocumentloader_impl.h" #include "webkit/glue/webdatasource_impl.h" #include "webkit/glue/weberror_impl.h" #include "webkit/glue/webframe_impl.h" @@ -544,8 +543,7 @@ void WebFrameImpl::LoadDocumentData(const KURL& base_url, } static WebDataSource* DataSourceForDocLoader(DocumentLoader* loader) { - return (loader ? - static_cast<WebDocumentLoaderImpl*>(loader)->GetDataSource() : NULL); + return loader ? WebDataSourceImpl::FromLoader(loader) : NULL; } WebDataSource* WebFrameImpl::GetDataSource() const { diff --git a/webkit/glue/webframeloaderclient_impl.cc b/webkit/glue/webframeloaderclient_impl.cc index 81dcc1d..7634fb0 100644 --- a/webkit/glue/webframeloaderclient_impl.cc +++ b/webkit/glue/webframeloaderclient_impl.cc @@ -49,7 +49,6 @@ MSVC_POP_WARNING(); #include "webkit/glue/plugins/plugin_list.h" #include "webkit/glue/searchable_form_data.h" #include "webkit/glue/webdatasource_impl.h" -#include "webkit/glue/webdocumentloader_impl.h" #include "webkit/glue/weberror_impl.h" #include "webkit/glue/webframeloaderclient_impl.h" #include "webkit/glue/webhistoryitem_impl.h" @@ -978,15 +977,15 @@ void WebFrameLoaderClient::dispatchUnableToImplementPolicy(const ResourceError&) void WebFrameLoaderClient::dispatchWillSubmitForm(FramePolicyFunction function, PassRefPtr<FormState> form_ref) { SearchableFormData* form_data = SearchableFormData::Create(form_ref->form()); - WebDocumentLoaderImpl* loader = static_cast<WebDocumentLoaderImpl*>( + WebDataSourceImpl* ds = WebDataSourceImpl::FromLoader( webframe_->frame()->loader()->provisionalDocumentLoader()); - // Don't free the SearchableFormData, the loader will do that. - loader->set_searchable_form_data(form_data); + // Don't free the SearchableFormData, the datasource will do that. + ds->set_searchable_form_data(form_data); PasswordForm* pass_data = PasswordFormDomManager::CreatePasswordForm(form_ref->form()); - // Don't free the PasswordFormData, the loader will do that. - loader->set_password_form_data(pass_data); + // Don't free the PasswordFormData, the datasource will do that. + ds->set_password_form_data(pass_data); WebViewImpl* webview = webframe_->webview_impl(); WebViewDelegate* d = webview->delegate(); @@ -1001,7 +1000,7 @@ void WebFrameLoaderClient::dispatchWillSubmitForm(FramePolicyFunction function, } } - loader->set_form_submit(true); + ds->set_form_submit(true); (webframe_->frame()->loader()->*function)(PolicyUse); } @@ -1248,17 +1247,9 @@ void WebFrameLoaderClient::prepareForDataSourceReplacement() { PassRefPtr<DocumentLoader> WebFrameLoaderClient::createDocumentLoader( const ResourceRequest& request, const SubstituteData& data) { - RefPtr<WebDocumentLoaderImpl> loader = WebDocumentLoaderImpl::create(request, - data); - - // Attach a datasource to the loader as a way of accessing requests. - WebDataSourceImpl* datasource = - WebDataSourceImpl::CreateInstance(webframe_, loader.get()); - loader->SetDataSource(datasource); - - webframe_->CacheCurrentRequestInfo(datasource); - - return loader.release(); + RefPtr<WebDataSourceImpl> ds = WebDataSourceImpl::Create(request, data); + webframe_->CacheCurrentRequestInfo(ds.get()); + return ds.release(); } void WebFrameLoaderClient::setTitle(const String& title, const KURL& url) { diff --git a/webkit/glue/webresponse_impl.h b/webkit/glue/webresponse_impl.h index da7f1cd..d21bcab82 100644 --- a/webkit/glue/webresponse_impl.h +++ b/webkit/glue/webresponse_impl.h @@ -5,6 +5,7 @@ #ifndef WEBKIT_GLUE_WEBRESPONSEIMPL_H_ #define WEBKIT_GLUE_WEBRESPONSEIMPL_H_ +#include "googleurl/src/gurl.h" #include "webkit/glue/glue_util.h" #include "webkit/glue/webresponse.h" diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp index 6f34053..970a59e8 100644 --- a/webkit/webkit.gyp +++ b/webkit/webkit.gyp @@ -4344,8 +4344,6 @@ 'glue/webdevtoolsclient_delegate.h', 'glue/webdevtoolsclient_impl.cc', 'glue/webdevtoolsclient_impl.h', - 'glue/webdocumentloader_impl.cc', - 'glue/webdocumentloader_impl.h', 'glue/webdropdata.cc', 'glue/webdropdata.h', 'glue/weberror.h', |