1967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch/*
22bde8e466a4451c7319e3a072d118917957d6554Steve Block * Copyright (C) 2010, 2011 Google Inc. All rights reserved.
3967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch *
4967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * Redistribution and use in source and binary forms, with or without
5967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * modification, are permitted provided that the following conditions are
6967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * met:
7967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch *
8967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch *     * Redistributions of source code must retain the above copyright
9967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * notice, this list of conditions and the following disclaimer.
10967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch *     * Redistributions in binary form must reproduce the above
11967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * copyright notice, this list of conditions and the following disclaimer
12967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * in the documentation and/or other materials provided with the
13967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * distribution.
14967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch *     * Neither the name of Google Inc. nor the names of its
15967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * contributors may be used to endorse or promote products derived from
16967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * this software without specific prior written permission.
17967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch *
18967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch */
30967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch
314576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang#ifndef AssociatedURLLoader_h
324576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang#define AssociatedURLLoader_h
33967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch
344576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang#include "WebURLLoader.h"
352daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch#include "WebURLLoaderOptions.h"
362bde8e466a4451c7319e3a072d118917957d6554Steve Block#include <wtf/Noncopyable.h>
374576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang#include <wtf/OwnPtr.h>
384576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang#include <wtf/RefPtr.h>
39967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch
402bde8e466a4451c7319e3a072d118917957d6554Steve Blocknamespace WebCore { class DocumentThreadableLoader; }
412bde8e466a4451c7319e3a072d118917957d6554Steve Block
42bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsennamespace WebKit {
43967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch
444576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wangclass WebFrameImpl;
454576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang
464576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang// This class is used to implement WebFrame::createAssociatedURLLoader.
472bde8e466a4451c7319e3a072d118917957d6554Steve Blockclass AssociatedURLLoader : public WebURLLoader {
482bde8e466a4451c7319e3a072d118917957d6554Steve Block    WTF_MAKE_NONCOPYABLE(AssociatedURLLoader);
494576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wangpublic:
504576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang    AssociatedURLLoader(PassRefPtr<WebFrameImpl>);
512bde8e466a4451c7319e3a072d118917957d6554Steve Block    AssociatedURLLoader(PassRefPtr<WebFrameImpl>, const WebURLLoaderOptions&);
524576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang    ~AssociatedURLLoader();
534576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang
544576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang    // WebURLLoader methods:
554576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang    virtual void loadSynchronously(const WebURLRequest&, WebURLResponse&, WebURLError&, WebData&);
564576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang    virtual void loadAsynchronously(const WebURLRequest&, WebURLLoaderClient*);
574576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang    virtual void cancel();
584576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang    virtual void setDefersLoading(bool);
594576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang
604576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wangprivate:
612bde8e466a4451c7319e3a072d118917957d6554Steve Block
622bde8e466a4451c7319e3a072d118917957d6554Steve Block    class ClientAdapter;
634576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang
644576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang    RefPtr<WebFrameImpl> m_frameImpl;
652bde8e466a4451c7319e3a072d118917957d6554Steve Block    WebURLLoaderOptions m_options;
662bde8e466a4451c7319e3a072d118917957d6554Steve Block    WebURLLoaderClient* m_client;
672bde8e466a4451c7319e3a072d118917957d6554Steve Block    OwnPtr<ClientAdapter> m_clientAdapter;
682bde8e466a4451c7319e3a072d118917957d6554Steve Block    RefPtr<WebCore::DocumentThreadableLoader> m_loader;
694576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang};
70967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch
714576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang} // namespace WebKit
72967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch
734576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang#endif
74