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

Side by Side Diff: components/dom_distiller/core/distiller_page.h

Issue 1384433002: distiller: Retires support of CreateNewContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Synced. Created 5 years, 2 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 COMPONENTS_DOM_DISTILLER_CORE_DISTILLER_PAGE_H_ 5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_DISTILLER_PAGE_H_
6 #define COMPONENTS_DOM_DISTILLER_CORE_DISTILLER_PAGE_H_ 6 #define COMPONENTS_DOM_DISTILLER_CORE_DISTILLER_PAGE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 protected: 52 protected:
53 // Called by |DistillPage| to carry out platform-specific instructions to load 53 // Called by |DistillPage| to carry out platform-specific instructions to load
54 // and distill the |url| using the provided |script|. The extracted content 54 // and distill the |url| using the provided |script|. The extracted content
55 // should be the same regardless of the DistillerPage implementation. 55 // should be the same regardless of the DistillerPage implementation.
56 virtual void DistillPageImpl(const GURL& url, const std::string& script) = 0; 56 virtual void DistillPageImpl(const GURL& url, const std::string& script) = 0;
57 57
58 // The value returned between the JavaScript and the DistillerPage can be 58 // The value returned between the JavaScript and the DistillerPage can be
59 // either a dictionary with all the content, or a stringified version. 59 // either a dictionary with all the content, or a stringified version.
60 virtual bool StringifyOutput() = 0; 60 virtual bool StringifyOutput() = 0;
61 61
62 // If true, forces the creation of a new window context to evaluate the
63 // JavaScript.
64 virtual bool CreateNewContext() = 0;
65
66 private: 62 private:
67 bool ready_; 63 bool ready_;
68 DistillerPageCallback distiller_page_callback_; 64 DistillerPageCallback distiller_page_callback_;
69 base::TimeTicks distillation_start_; 65 base::TimeTicks distillation_start_;
70 DISALLOW_COPY_AND_ASSIGN(DistillerPage); 66 DISALLOW_COPY_AND_ASSIGN(DistillerPage);
71 }; 67 };
72 68
73 // Factory for generating a |DistillerPage|. 69 // Factory for generating a |DistillerPage|.
74 class DistillerPageFactory { 70 class DistillerPageFactory {
75 public: 71 public:
76 virtual ~DistillerPageFactory(); 72 virtual ~DistillerPageFactory();
77 73
78 // Constructs and returns a new DistillerPage. The implementation of this 74 // Constructs and returns a new DistillerPage. The implementation of this
79 // should be very cheap, since the pages can be thrown away without being 75 // should be very cheap, since the pages can be thrown away without being
80 // used. 76 // used.
81 virtual scoped_ptr<DistillerPage> CreateDistillerPage( 77 virtual scoped_ptr<DistillerPage> CreateDistillerPage(
82 const gfx::Size& render_view_size) const = 0; 78 const gfx::Size& render_view_size) const = 0;
83 virtual scoped_ptr<DistillerPage> CreateDistillerPageWithHandle( 79 virtual scoped_ptr<DistillerPage> CreateDistillerPageWithHandle(
84 scoped_ptr<SourcePageHandle> handle) const = 0; 80 scoped_ptr<SourcePageHandle> handle) const = 0;
85 }; 81 };
86 82
87 } // namespace dom_distiller 83 } // namespace dom_distiller
88 84
89 #endif // COMPONENTS_DOM_DISTILLER_CORE_DISTILLER_PAGE_H_ 85 #endif // COMPONENTS_DOM_DISTILLER_CORE_DISTILLER_PAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698