Commit 2b36a509 authored by droger's avatar droger Committed by Commit bot

Move webp_transcode to ios/chrome/browser

webp_transcode is now only used from ios/chrome/browser.

BUG=627509
TBR=jam

Review-Url: https://codereview.chromium.org/2146833002
Cr-Commit-Position: refs/heads/master@{#405982}
parent c451c080
......@@ -161,11 +161,6 @@ test("components_unittests") {
"//components/signin/ios/browser:unit_tests",
"//components/translate/ios/browser:unit_tests",
]
if (current_cpu != "arm") {
# TODO(GYP): iOS arm builds of libwebp don't work yet.
deps += [ "//components/webp_transcode:unit_tests" ]
}
} else { # !iOS
deps += [
"//components/autofill/content/browser:unit_tests",
......
......@@ -245,8 +245,6 @@ per-file webdata_services.gypi=file://components/webdata_services/OWNERS
per-file webmessaging.gypi=file://components/webmessaging/OWNERS
per-file webp_transcode.gypi=file://components/webp_transcode/OWNERS
per-file wifi.gypi=file://components/wifi/OWNERS
per-file *.isolate=maruel@chromium.org
......
......@@ -143,11 +143,6 @@
'zoom.gypi',
],
}],
['OS == "ios"', {
'includes': [
'webp_transcode.gypi',
],
}],
['OS != "ios" and OS != "android"', {
'includes': [
'feedback.gypi',
......
......@@ -1052,7 +1052,7 @@
'<@(gcm_driver_unittest_sources)',
'<@(google_unittest_sources)',
'<@(history_unittest_sources)',
'<@(image_fetcher_unittest_sources)',
'<@(image_fetcher_unittest_sources)',
'<@(instance_id_unittest_sources)',
'<@(json_schema_unittest_sources)',
'<@(keyed_service_unittest_sources)',
......@@ -1419,9 +1419,6 @@
}],
],
}, { # 'OS == "ios"'
'sources': [
'webp_transcode/webp_decoder_unittest.mm',
],
'sources/': [
# Exclude all tests that depends on //content (based on layered-
# component directory structure).
......@@ -1438,7 +1435,6 @@
'components.gyp:signin_ios_browser',
'components.gyp:signin_ios_browser_test_support',
'components.gyp:translate_ios_browser',
'components.gyp:webp_transcode',
],
'actions': [
{
......
# Copyright 2013 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.
{
'targets': [
{
# GN version: //components/webp_transcode
'target_name': 'webp_transcode',
'type': 'static_library',
'dependencies': [
'../base/base.gyp:base',
'../ios/net/ios_net.gyp:ios_net',
'../net/net.gyp:net',
'../third_party/libwebp/libwebp.gyp:libwebp_dec',
],
'include_dirs': [
'..',
],
'sources': [
'webp_transcode/webp_decoder.h',
'webp_transcode/webp_decoder.mm',
],
},
],
}
# Copyright 2015 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.
source_set("webp_transcode") {
sources = [
"webp_decoder.h",
"webp_decoder.mm",
]
deps = [
"//base",
"//ios/net",
"//net",
"//third_party/libwebp:libwebp_dec",
]
}
bundle_data("unit_tests_bundle_data") {
visibility = [ ":unit_tests" ]
testonly = true
sources = [
"//components/test/data/webp_transcode/test.jpg",
"//components/test/data/webp_transcode/test.webp",
"//components/test/data/webp_transcode/test_alpha.png",
"//components/test/data/webp_transcode/test_alpha.webp",
"//components/test/data/webp_transcode/test_small.tiff",
"//components/test/data/webp_transcode/test_small.webp",
]
outputs = [
"{{bundle_resources_dir}}/" +
"{{source_root_relative_dir}}/{{source_file_part}}",
]
}
source_set("unit_tests") {
testonly = true
sources = [
"webp_decoder_unittest.mm",
]
deps = [
":unit_tests_bundle_data",
":webp_transcode",
"//base",
"//net",
"//net:test_support",
"//testing/gmock",
"//testing/gtest",
"//third_party/ocmock",
]
}
......@@ -11,6 +11,12 @@ bundle_data("ios_chrome_unittests_bundle_data") {
sources = [
"test/data/webdata/bookmarkimages/image.jpg",
"test/data/webdata/bookmarkimages/index.html",
"test/data/webp_transcode/test.jpg",
"test/data/webp_transcode/test.webp",
"test/data/webp_transcode/test_alpha.png",
"test/data/webp_transcode/test_alpha.webp",
"test/data/webp_transcode/test_small.tiff",
"test/data/webp_transcode/test_small.webp",
]
outputs = [
"{{bundle_resources_dir}}/{{source_root_relative_dir}}/" +
......@@ -69,6 +75,7 @@ test("ios_chrome_unittests") {
"browser/ui/uikit_ui_util_unittest.mm",
"browser/update_client/ios_chrome_update_query_params_delegate_unittest.cc",
"browser/web_resource/web_resource_util_unittest.cc",
"browser/webp_transcode/webp_decoder_unittest.mm",
"common/string_util_unittest.mm",
]
......
......@@ -574,6 +574,8 @@ source_set("browser") {
"web_data_service_factory.h",
"web_resource/web_resource_util.cc",
"web_resource/web_resource_util.h",
"webp_transcode/webp_decoder.h",
"webp_transcode/webp_decoder.mm",
"xcallback_parameters.h",
"xcallback_parameters.mm",
]
......@@ -667,7 +669,6 @@ source_set("browser") {
"//components/version_ui",
"//components/web_resource",
"//components/webdata_services",
"//components/webp_transcode",
"//google_apis",
"//ios/chrome/browser/variations:ios_chrome_ui_string_overrider_factory",
"//ios/chrome/common",
......@@ -685,6 +686,7 @@ source_set("browser") {
"//sync",
"//third_party/brotli",
"//third_party/google_toolbox_for_mac",
"//third_party/libwebp:libwebp_dec",
"//ui/base",
"//ui/gfx",
"//ui/resources",
......
......@@ -11,7 +11,7 @@
#include "base/location.h"
#include "base/mac/scoped_nsobject.h"
#include "base/task_runner.h"
#include "components/webp_transcode/webp_decoder.h"
#include "ios/chrome/browser/webp_transcode/webp_decoder.h"
#include "ios/web/public/web_thread.h"
#include "net/base/load_flags.h"
#include "net/http/http_response_headers.h"
......
include_rules = [
"+net",
# Only WebP decoding is allowed (no encoding).
"+third_party/libwebp/webp/decode.h",
"+third_party/ocmock",
# webp_transcode should not depend on //ios for library size reasons.
"-ios",
"+ios/net",
# webp_transcode is only used by iOS.
"-content",
]
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_WEBP_TRANSCODE_WEBP_DECODER_H_
#define COMPONENTS_WEBP_TRANSCODE_WEBP_DECODER_H_
#ifndef IOS_CHROME_BROWSER_WEBP_TRANSCODE_WEBP_DECODER_H_
#define IOS_CHROME_BROWSER_WEBP_TRANSCODE_WEBP_DECODER_H_
#import <Foundation/Foundation.h>
#include <stddef.h>
......@@ -75,4 +75,4 @@ class WebpDecoder : public base::RefCountedThreadSafe<WebpDecoder> {
} // namespace webp_transcode
#endif // COMPONENTS_WEBP_TRANSCODE_WEBP_DECODER_H_
#endif // IOS_CHROME_BROWSER_WEBP_TRANSCODE_WEBP_DECODER_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/webp_transcode/webp_decoder.h"
#include "ios/chrome/browser/webp_transcode/webp_decoder.h"
#import <Foundation/Foundation.h>
#include <stdint.h>
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/webp_transcode/webp_decoder.h"
#include "ios/chrome/browser/webp_transcode/webp_decoder.h"
#import <CoreGraphics/CoreGraphics.h>
#import <Foundation/Foundation.h>
......@@ -55,7 +55,7 @@ class WebpDecoderTest : public testing::Test {
NSData* LoadImage(const base::FilePath& filename) {
base::FilePath path;
PathService::Get(base::DIR_SOURCE_ROOT, &path);
path = path.AppendASCII("components/test/data/webp_transcode")
path = path.AppendASCII("ios/chrome/test/data/webp_transcode")
.Append(filename);
return
[NSData dataWithContentsOfFile:base::SysUTF8ToNSString(path.value())];
......@@ -227,8 +227,9 @@ TEST_F(WebpDecoderTest, DecodeToTiff) {
ASSERT_TRUE(tiff_image != nil);
// Convert to TIFF.
EXPECT_CALL(*delegate_, OnFinishedDecoding(true)).Times(1);
EXPECT_CALL(*delegate_, SetImageFeatures([tiff_image length],
WebpDecoder::TIFF)).Times(1);
EXPECT_CALL(*delegate_,
SetImageFeatures([tiff_image length], WebpDecoder::TIFF))
.Times(1);
decoder_->OnDataReceived(webp_image);
// Compare to reference image.
EXPECT_TRUE(CheckTiffImagesEqual(tiff_image, delegate_->GetImage()));
......
......@@ -119,7 +119,6 @@
'../../components/components.gyp:version_ui',
'../../components/components.gyp:web_resource',
'../../components/components.gyp:webdata_services',
'../../components/components.gyp:webp_transcode',
'../../components/components_resources.gyp:components_resources',
'../../components/components_strings.gyp:components_strings',
'../../components/prefs/prefs.gyp:prefs',
......@@ -132,6 +131,7 @@
'../../sync/sync.gyp:sync',
'../../third_party/brotli/brotli.gyp:brotli',
'../../third_party/google_toolbox_for_mac/google_toolbox_for_mac.gyp:google_toolbox_for_mac',
'../../third_party/libwebp/libwebp.gyp:libwebp_dec',
'../../ui/base/ui_base.gyp:ui_base',
'../../ui/gfx/gfx.gyp:gfx',
'../../url/url.gyp:url_lib',
......@@ -707,6 +707,8 @@
'browser/web/dom_altering_lock.mm',
'browser/web/resubmit_data_controller.h',
'browser/web/resubmit_data_controller.mm',
'browser/webp_transcode/webp_decoder.h',
'browser/webp_transcode/webp_decoder.mm',
'browser/web_data_service_factory.cc',
'browser/web_data_service_factory.h',
'browser/web_resource/web_resource_util.cc',
......
......@@ -88,6 +88,7 @@
'browser/ui/uikit_ui_util_unittest.mm',
'browser/update_client/ios_chrome_update_query_params_delegate_unittest.cc',
'browser/web_resource/web_resource_util_unittest.cc',
'browser/webp_transcode/webp_decoder_unittest.mm',
'common/string_util_unittest.mm',
],
'actions': [
......@@ -96,7 +97,7 @@
'variables': {
'test_data_files': [
'../../net/data/ssl/certificates/',
'test/data/webdata/bookmarkimages',
'test/data',
],
'test_data_prefix': 'ios/chrome',
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment